@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  color: #1e293b;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.container {
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.1);
  padding: 48px 40px;
  width: 100%;
  max-width: 480px;
  text-align: center;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 32px;
  font-weight: 400;
}

.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 50px 20px;
  background-color: #f8fafc;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 24px;
}

.dropzone:hover, .dropzone.active {
  border-color: #3b82f6;
  background-color: #eff6ff;
  transform: translateY(-2px);
}

.dropzone p {
  font-size: 16px;
  font-weight: 500;
  color: #475569;
  pointer-events: none;
}

#fileBox {
  display: none;
}

button#submitBtn {
  width: 100%;
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

button#submitBtn:hover:not(:disabled) {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

button#submitBtn:active:not(:disabled) {
  transform: translateY(1px);
}

button#submitBtn:disabled {
  background-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

#status {
  margin-top: 20px;
  font-size: 15px;
  font-weight: 500;
  display: none;
  color: #475569;
}

.resultbox {
  margin-top: 24px;
  padding: 24px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  display: none;
  text-align: left;
  word-break: break-all;
}

.resultbox p {
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 12px;
}

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

.result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.result-content {
  flex-grow: 1;
  min-width: 0;
}

.result-filename {
  font-weight: 600;
  color: #0f172a;
  font-size: 14.5px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-link {
  font-size: 13.5px;
  line-height: 1.4;
}

.result-link a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  word-break: break-all;
  display: inline-block;
}

.result-link a:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.result-error {
  font-size: 13.5px;
  color: #ef4444;
  font-weight: 500;
}

.copy-btn {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background-color: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-left: auto;
}

.copy-btn:hover {
  background-color: #059669;
}

.loader {
  border: 3px solid #e2e8f0;
  border-top: 3px solid #2563eb;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Tab Navigation */
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #ffffff;
    font-weight: 600;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Search Vidoy Layout */
#tab-search {
    background-color: #1a1e24;
    border-radius: 12px;
    padding: 24px;
    color: #e2e8f0;
}

#tab-search h1 {
    color: #ffffff;
}

.search-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

#searchInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #3b4252;
    border-radius: 12px;
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.2s;
    background: #232731;
    color: #ffffff;
}

#searchInput:focus {
    border-color: #5c6a8a !important;
}

#searchBtn {
    padding: 12px 24px;
    background: #3b82f6 !important;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.vidoy-result-item {
    display: flex;
    flex-direction: column;
    padding: 0 0 16px 0;
    background: #232731;
    border-radius: 8px;
    border: 1px solid #3b4252;
    transition: background 0.2s;
    overflow: hidden;
}

.vidoy-result-item:hover {
    background: #2e3440;
}

.vidoy-thumb {
    width: 100%;
    height: 280px;
    object-fit: contain;
    background: #000000;
    margin-bottom: 12px;
}

.vidoy-info {
    padding: 0 16px;
    text-align: left;
    margin-bottom: 12px;
}

.vidoy-title {
    font-weight: 600;
    font-size: 16px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.vidoy-meta {
    font-size: 12px;
    color: #8f9bb3;
    font-weight: 500;
}

.vidoy-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
}

.btn-play {
    background: #3b4252;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-play:hover {
    background: #4c566a;
}

.btn-copy {
    background: #f43f5e;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #e11d48;
}

.vidoy-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #3b4252;
    font-size: 13px;
    color: #8f9bb3;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-btn {
    background: #232731;
    color: #ffffff;
    border: 1px solid #3b4252;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.page-btn.active {
    background: #f43f5e;
    border-color: #f43f5e;
}

.page-btn:hover:not(.active) {
    background: #2e3440;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-jump input {
    background: #1a1e24;
    border: 1px solid #3b4252;
    color: #ffffff;
    padding: 6px;
    width: 60px;
    border-radius: 4px;
    text-align: center;
    outline: none;
}

.page-jump input:focus {
    border-color: #5c6a8a;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 32px 16px;
        border-radius: 12px;
    }
    
    .search-group {
        flex-direction: column;
    }
    
    #searchBtn {
        width: 100%;
        padding: 14px;
    }
    
    .vidoy-pagination {
        flex-direction: column;
        gap: 16px;
    }
    
    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .page-jump {
        justify-content: center;
        width: 100%;
    }
}
