@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2c5f7c;
    --primary-dark: #1a3a4d;
    --secondary: #d4a574;
    --accent: #e8927c;
    --bg-light: #f8f9fa;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; 
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef3 100%);
    color: var(--text-dark); 
    line-height: 1.6; 
    min-height: 100vh; 
}

/* Header */
header { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; 
    padding: 1.5rem 0; 
    box-shadow: var(--shadow-lg);
    position: sticky; 
    top: 0; 
    z-index: 100; 
}
.header-content { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 2rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
header h1 { 
    font-family: 'Playfair Display', serif; 
    font-size: 1.8rem; 
    font-weight: 900;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
nav { display: flex; gap: 0.5rem; }
nav a { 
    color: white; 
    text-decoration: none; 
    padding: 0.6rem 1.2rem; 
    border-radius: 20px; 
    transition: all 0.3s; 
    font-weight: 500; 
    background: rgba(255,255,255,0.15);
    font-size: 0.9rem;
}
nav a:hover { 
    background: rgba(255,255,255,0.25); 
    transform: translateY(-2px); 
}

/* Main */
main { max-width: 1400px; margin: 0 auto; padding: 2rem; }

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}
.hero-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 900;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Search Panel */
.search-panel { 
    background: white; 
    padding: 2.5rem; 
    border-radius: 20px; 
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem; 
}
.search-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.input-group, .filter-group {
    display: flex;
    flex-direction: column;
}
.input-group label, .filter-group label {
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-dark);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.search-panel input, .search-panel select { 
    padding: 0.9rem 1.2rem; 
    border: 2px solid #e0e6ed; 
    border-radius: 12px; 
    font-size: 1rem; 
    transition: all 0.3s; 
    background: var(--bg-light);
    font-family: 'Inter', sans-serif;
}
.search-panel input:focus, .search-panel select:focus { 
    outline: none; 
    border-color: var(--primary); 
    background: white; 
    box-shadow: 0 0 0 3px rgba(44,95,124,0.1); 
}
.search-actions { 
    display: flex; 
    gap: 1rem; 
    justify-content: center; 
}
.btn-search { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; 
    border: none; 
    padding: 1rem 3rem; 
    border-radius: 25px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.3s; 
    box-shadow: var(--shadow-md);
    font-size: 1.05rem;
}
.btn-search:hover { 
    transform: translateY(-3px); 
    box-shadow: var(--shadow-lg);
}
.btn-reset { 
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white; 
    padding: 1rem 2.5rem; 
    border-radius: 25px; 
    text-decoration: none; 
    display: inline-block; 
    transition: all 0.3s; 
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.btn-reset:hover { 
    transform: translateY(-3px); 
    box-shadow: var(--shadow-md);
}

/* Results Banner */
.results-banner {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
}
.results-count {
    text-align: center;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.count-number {
    font-size: 3rem;
    font-weight: 900;
    font-family: 'Playfair Display', serif;
}
.count-label {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Documents Grid */
.documents-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
    gap: 2.5rem; 
    margin-bottom: 3rem; 
}
.document-card { 
    background: white; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    position: relative;
}
.document-card:hover { 
    transform: translateY(-10px); 
    box-shadow: var(--shadow-lg);
}
.card-header {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}
.doc-type-badge {
    background: rgba(255,255,255,0.95);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.doc-image { 
    height: 300px; 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    overflow: hidden; 
    position: relative; 
}
.doc-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s; 
}
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.doc-image:hover .image-overlay {
    opacity: 1;
}
.doc-image:hover img { 
    transform: scale(1.15); 
}
.zoom-icon {
    font-size: 4rem;
    filter: drop-shadow(2px 2px 8px rgba(0,0,0,0.5));
}
.pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.pdf-placeholder:hover {
    transform: scale(1.05);
}
.pdf-icon { 
    font-size: 6rem; 
    opacity: 0.9; 
}
.pdf-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 2px;
}
.pdf-hint {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    font-style: italic;
}
.doc-content { 
    padding: 2rem; 
}
.doc-title { 
    color: var(--primary); 
    margin-bottom: 1.5rem; 
    font-size: 1.5rem; 
    font-family: 'Playfair Display', serif; 
    font-weight: 700;
    border-bottom: 3px solid var(--secondary);
    padding-bottom: 0.8rem;
}
.doc-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.8rem;
    background: var(--bg-light);
    border-radius: 12px;
}
.detail-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.detail-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.detail-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.detail-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}
.doc-note { 
    background: linear-gradient(135deg, #fff9f0 0%, #ffe8d6 100%);
    padding: 1.2rem; 
    border-radius: 12px; 
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--secondary);
    display: flex;
    gap: 1rem;
}
.note-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.doc-note p {
    font-style: italic;
    color: var(--text-dark);
    line-height: 1.6;
}
.doc-actions { 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem; 
}
.btn-action { 
    padding: 0.9rem; 
    border: none; 
    border-radius: 12px; 
    cursor: pointer; 
    font-size: 0.95rem; 
    text-align: center; 
    text-decoration: none; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600; 
    transition: all 0.3s; 
}
.btn-download { 
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white; 
    box-shadow: var(--shadow-sm);
}
.btn-download:hover { 
    transform: translateY(-2px); 
    box-shadow: var(--shadow-md);
}
.btn-print { 
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: white; 
    box-shadow: var(--shadow-sm);
}
.btn-print:hover { 
    transform: translateY(-2px); 
    box-shadow: var(--shadow-md);
}

/* Empty State */
.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 5rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}
.empty-icon {
    font-size: 6rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}
.empty-state h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}
.empty-state p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 25px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Admin Styles */
.upload-section { 
    background: white; 
    padding: 2.5rem; 
    border-radius: 20px; 
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem; 
}
.upload-section h3 { 
    font-family: 'Playfair Display', serif; 
    color: var(--primary); 
    margin-bottom: 1.5rem; 
    font-size: 1.8rem; 
}
.upload-form { 
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem; 
}
.form-group { 
    display: flex; 
    flex-direction: column; 
}
.form-group label { 
    font-weight: 600; 
    margin-bottom: 0.5rem; 
    color: var(--text-dark); 
}
.upload-form input, .upload-form select, .upload-form textarea { 
    padding: 0.9rem 1.2rem; 
    border: 2px solid #e0e6ed; 
    border-radius: 12px; 
    font-size: 1rem; 
    transition: all 0.3s; 
    background: var(--bg-light);
    font-family: 'Inter', sans-serif;
}
.upload-form input:focus, .upload-form select:focus, .upload-form textarea:focus { 
    outline: none; 
    border-color: var(--primary); 
    background: white; 
    box-shadow: 0 0 0 3px rgba(44,95,124,0.1); 
}
.form-row { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 1.5rem; 
}
.admin-table { 
    background: white; 
    padding: 1.5rem; 
    border-radius: 20px; 
    box-shadow: var(--shadow-md);
    overflow-x: auto; 
}
table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0; 
}
th, td { 
    padding: 1.2rem; 
    text-align: left; 
    border-bottom: 1px solid #ecf0f1; 
}
th { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    font-weight: 600; 
    color: white; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    font-size: 0.85rem; 
}
tr:hover { 
    background: var(--bg-light);
}
.thumb-small { 
    width: 70px; 
    height: 70px; 
    object-fit: cover; 
    border-radius: 8px; 
    box-shadow: var(--shadow-sm);
}
.btn-small { 
    padding: 0.5rem 1rem; 
    font-size: 0.85rem; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; 
    transition: all 0.3s; 
}
.btn-small:hover { 
    transform: translateY(-2px); 
    box-shadow: var(--shadow-sm);
}
.btn-danger { 
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white; 
}
.btn-danger:hover { 
    box-shadow: var(--shadow-sm);
}

/* Login */
.login-box { 
    max-width: 450px; 
    margin: 5rem auto; 
    background: white; 
    padding: 3.5rem; 
    border-radius: 20px; 
    box-shadow: var(--shadow-lg);
    text-align: center; 
}
.login-box h2 { 
    color: var(--primary); 
    margin-bottom: 2rem; 
    font-family: 'Playfair Display', serif; 
    font-size: 2rem; 
}
.login-box form { 
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem; 
}
.login-box input { 
    padding: 1rem 1.5rem; 
    border: 2px solid #e0e6ed; 
    border-radius: 12px; 
    font-size: 1.1rem; 
}

/* Flash */
.flash { 
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724; 
    padding: 1.2rem; 
    border-radius: 12px; 
    margin-bottom: 1.5rem; 
    border-left: 4px solid #28a745; 
    box-shadow: var(--shadow-sm);
    font-weight: 500; 
}

/* Footer */
footer { 
    text-align: center; 
    padding: 3rem; 
    color: var(--text-light);
    margin-top: 4rem; 
    background: rgba(255,255,255,0.5); 
    border-radius: 20px 20px 0 0; 
    font-size: 0.95rem; 
}

/* Lightbox */
.lightbox { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.95);
    z-index: 1000; 
    justify-content: center; 
    align-items: center; 
    backdrop-filter: blur(10px); 
}
.lightbox.active { 
    display: flex; 
    animation: fadeIn 0.3s; 
}
.lightbox-content { 
    max-width: 90%; 
    max-height: 85%; 
    border-radius: 12px; 
    box-shadow: var(--shadow-lg);
    animation: zoomIn 0.3s; 
}
.lightbox-close { 
    position: absolute; 
    top: 30px; 
    right: 40px; 
    color: white; 
    font-size: 50px; 
    cursor: pointer; 
    transition: all 0.3s; 
    background: rgba(0,0,0,0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}
.lightbox-close:hover { 
    transform: rotate(90deg) scale(1.1);
    background: rgba(231,76,60,0.8);
}
.lightbox-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
}
.lightbox-btn {
    background: rgba(255,255,255,0.9);
    color: var(--primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}
.lightbox-btn:hover {
    background: white;
    transform: translateY(-2px);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media print { 
    header, nav, .search-panel, .btn-download, .btn-print, footer { display: none; } 
    .document-card { page-break-inside: avoid; box-shadow: none; } 
}
@media (max-width: 768px) { 
    .documents-grid { grid-template-columns: 1fr; } 
    .search-inputs, .search-filters { grid-template-columns: 1fr; } 
    header h1 { font-size: 1.3rem; }
    .hero-section h2 { font-size: 1.8rem; }
    .count-number { font-size: 2rem; }
}
