* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
}

/* Page Sections */
.page {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.page.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.page-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.fade-in-delay {
    animation: fadeIn 0.6s ease 0.2s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 0.6s ease 0.4s forwards;
    opacity: 0;
}

.fade-in-delay-3 {
    animation: fadeIn 0.6s ease 0.6s forwards;
    opacity: 0;
}

/* Login Page */
.login-container {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    max-width: 450px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.logo {
    margin-bottom: 30px;
}

.login-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #1a202c;
}

.subtitle {
    color: #718096;
    margin-bottom: 40px;
    font-size: 16px;
}

.login-form {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.login-footer {
    color: #718096;
    font-size: 14px;
}

.login-footer strong {
    color: #667eea;
}

/* Welcome Page */
.welcome-container {
    text-align: center;
    color: white;
}

.big-title {
    font-size: 72px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.1;
}

.big-subtitle {
    font-size: 24px;
    margin-bottom: 60px;
    opacity: 0.9;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s, background 0.3s;
}

.feature:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.feature p {
    opacity: 0.9;
    line-height: 1.6;
}

.btn-large {
    padding: 20px 50px;
    font-size: 20px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-large:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.arrow {
    transition: transform 0.3s;
}

.btn-large:hover .arrow {
    transform: translateX(5px);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    opacity: 0.7;
}

.scroll-arrow {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* Upload Page */
.upload-container {
    background: white;
    border-radius: 20px;
    padding: 60px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.back-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 30px;
    padding: 10px 0;
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: translateX(-5px);
}

.page-title {
    font-size: 36px;
    margin-bottom: 10px;
    color: #1a202c;
}

.page-subtitle {
    color: #718096;
    margin-bottom: 40px;
    font-size: 18px;
}

.upload-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1a202c;
}

.doc-name-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 5px;
    transition: border-color 0.3s;
}

.doc-name-input:focus {
    outline: none;
    border-color: #667eea;
}

.input-hint {
    color: #a0aec0;
    font-size: 14px;
    margin-bottom: 30px;
}

.file-upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 30px;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.file-upload-area.dragover {
    border-color: #667eea;
    background: #edf2f7;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 18px;
    color: #4a5568;
    margin-bottom: 10px;
}

.link {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
}

.upload-hint {
    color: #a0aec0;
    font-size: 14px;
}

.file-preview {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.file-preview.hidden {
    display: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 32px;
}

.file-details {
    flex: 1;
    text-align: left;
}

.file-name {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 5px;
}

.file-size {
    color: #718096;
    font-size: 14px;
}

.remove-file {
    background: #fed7d7;
    color: #c53030;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.remove-file:hover {
    background: #fc8181;
}

.upload-options {
    margin-bottom: 30px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    cursor: pointer;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.btn-upload {
    width: 100%;
    margin-bottom: 20px;
}

.btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-progress {
    text-align: center;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    color: #718096;
    font-size: 14px;
}

.upload-success {
    text-align: center;
    padding: 40px 0;
}

.upload-success.hidden {
    display: none;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #48bb78;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 20px;
}

.upload-success h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #1a202c;
}

.upload-success p {
    color: #718096;
    margin-bottom: 30px;
}

.btn-secondary {
    padding: 12px 30px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-text {
    padding: 12px 30px;
    background: none;
    color: #718096;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-text:hover {
    color: #667eea;
}

/* Search Page */
.search-container {
    background: white;
    border-radius: 20px;
    padding: 60px;
    min-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-search {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s;
}

.btn-search:hover {
    transform: translateY(-2px);
}

.search-icon {
    font-size: 20px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #a0aec0;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #718096;
}

.result-card {
    background: #f7fafc;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s;
}

.result-card:hover {
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.result-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-toggle {
    background: #edf2f7;
    border: 1px solid #cbd5e0;
    font-size: 13px;
    cursor: pointer;
    color: #4a5568;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.btn-toggle:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.result-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 5px;
}

.result-meta {
    color: #718096;
    font-size: 14px;
}

.result-snippet {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 3px solid #667eea;
}

.snippet-label {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 5px;
}

.snippet-text {
    color: #4a5568;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-small {
    padding: 8px 16px;
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #667eea;
    color: white;
}

/* Upload tabs */
.upload-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.upload-tab {
    padding: 10px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.upload-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* ZIP batch results */
.zip-result-item {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
    text-align: left;
}

.zip-ok {
    background: #f0fff4;
    color: #276749;
}

.zip-err {
    background: #fff5f5;
    color: #c53030;
}

/* Responsive */
@media (max-width: 768px) {
    .big-title {
        font-size: 48px;
    }
    
    .big-subtitle {
        font-size: 18px;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .upload-container,
    .search-container {
        padding: 20px 16px;
    }
    
    .search-header {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .search-box {
        flex-direction: column;
    }

    .result-card {
        padding: 16px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .result-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .btn-small, .btn-toggle {
        flex: 1;
        text-align: center;
        font-size: 13px;
        padding: 8px 10px;
    }

    .result-title {
        font-size: 16px;
    }
}
