/* Import base styles from main CSS */
@import url('index.css');

/* Navigation Dropdown Styles for Diplomas Page */
.nav-more-dropdown {
    position: relative;
}

.nav-more-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-more-toggle i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-more-dropdown:hover .nav-more-toggle i {
    transform: rotate(180deg);
}

.nav-more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
}

.nav-more-dropdown:hover .nav-more-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-more-menu li {
    margin: 0;
}

.nav-more-menu .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
}

.nav-more-menu .nav-link:hover {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.nav-more-menu .nav-link::after {
    display: none;
}

/* Override and additional styles for diplomas page */
body {
    background-color: #f8fafc;
}

/* Hero Section for Diplomas Page */
.hero {
    min-height: 40vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    padding-top: 120px;
    color: white;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.8;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
    opacity: 1;
}

/* Filter Section */
.filter-section {
    padding: 2rem 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.filter-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s ease;
    outline: none;
    font-size: 0.95rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Documents Grid */
.documents-section {
    padding: 4rem 0;
    min-height: 60vh;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.document-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.document-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.document-preview {
    position: relative;
    height: 220px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
}

.document-preview .pdf-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    border-radius: 12px;
}

.document-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}

.document-preview .pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #64748b;
    transition: opacity 0.3s ease;
}

.document-preview .pdf-placeholder i {
    font-size: 3rem;
}

.document-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.document-card:hover .document-overlay {
    opacity: 1;
}

.document-overlay .overlay-content {
    text-align: center;
    color: white;
}

.document-overlay .overlay-content i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.document-overlay .overlay-content p {
    font-weight: 600;
    margin: 0;
}

.document-info {
    padding: 1.5rem;
}

.document-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.document-category.my_achievements {
    background: #dcfce7;
    color: #166534;
}

.document-category.student_achievements {
    background: #fef3c7;
    color: #92400e;
}

.document-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.document-info p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.document-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.document-date {
    color: #9ca3af;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #2563eb;
    color: white;
    transform: scale(1.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
}

.modal-body {
    padding: 0;
}

.pdf-viewer {
    height: 60vh;
    background: #f8fafc;
}

.pdf-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

/* Loading Indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: #6b7280;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    padding: 4rem 0;
    text-align: center;
    color: #6b7280;
}

.empty-content i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .filter-controls {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .document-card {
        max-width: 100%;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-actions {
        padding: 1rem 1.5rem;
    }
    
    .pdf-viewer {
        height: 50vh;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .filter-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .document-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Accessibility */
.document-card:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.filter-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.modal-close:focus,
.action-btn:focus,
.btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .filter-section,
    .modal {
        display: none;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .document-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}