/* Faculty Directory Page */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    line-height: 1.7;
    color: #1a202c;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #8B4513 100%);
    background-attachment: fixed;
    font-family: 'Georgia', 'Times New Roman', serif;
    cursor: default;
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    height: 50vh;
    min-height: 300px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8) 0%, rgba(160, 82, 45, 0.8) 50%, rgba(205, 133, 63, 0.8) 100%), 
                url('../../../images/hero2.jpeg') center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.3);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Main Container */
.article-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Back Button */
.back-button-container {
    margin-bottom: 2rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.back-btn:hover {
    background: linear-gradient(135deg, #A0522D 0%, #CD853F 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
    color: white;
    text-decoration: none;
}

.back-btn span {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Section Title */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #2c3e50;
    font-weight: 300;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(45deg, #8B4513, #A0522D);
    margin: 1rem auto;
    border-radius: 2px;
}

/* Department Sections */
.department-section {
    margin-bottom: 4rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.15);
    overflow: hidden;
    border: 1px solid rgba(139, 69, 19, 0.2);
}

.department-header {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #CD853F 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
}

.department-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.department-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Faculty Organizational Chart */
.faculty-org-chart {
    padding: 2rem;
}

/* Coordinator Level */
.coordinator-level {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Connection Lines */
.connection-line {
    height: 2px;
    background: linear-gradient(90deg, #bdc3c7 0%, #ecf0f1 50%, #bdc3c7 100%);
    margin: 1.5rem 0;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

/* Teachers Level */
.teachers-level {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Level Leader Section */
.level-leader-section {
    margin: 2rem 0;
    text-align: center;
}

.level-leaders {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.section-label {
    font-size: 1.4rem;
    color: #805ad5;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 500;
    padding: 0.8rem;
    background: linear-gradient(135deg, rgba(128, 90, 213, 0.1) 0%, rgba(128, 90, 213, 0.05) 100%);
    border-radius: 12px;
    border: 2px solid rgba(128, 90, 213, 0.2);
}

.teacher-group {
    margin-bottom: 2rem;
}

.grade-label {
    font-size: 1.3rem;
    color: #4299e1;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
    padding: 0.8rem;
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.1) 0%, rgba(66, 153, 225, 0.05) 100%);
    border-radius: 12px;
    border: 2px solid rgba(66, 153, 225, 0.2);
}

.teacher-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Faculty Cards */
.faculty-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.faculty-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Coordinator Cards */
.faculty-card.coordinator {
    border-color: #ed8936;
    background: linear-gradient(135deg, #fff 0%, #fffaf0 100%);
    min-width: 300px;
    box-shadow: 0 8px 25px rgba(237, 137, 54, 0.15);
}

.faculty-card.coordinator:hover {
    border-color: #dd6b20;
    background: linear-gradient(135deg, #fffaf0 0%, #fef5e7 100%);
    box-shadow: 0 12px 35px rgba(237, 137, 54, 0.25);
}

/* Level Leader Cards */
.faculty-card.level-leader {
    border-color: #805ad5;
    background: linear-gradient(135deg, #fff 0%, #faf5ff 100%);
    min-width: 280px;
    box-shadow: 0 8px 25px rgba(128, 90, 213, 0.15);
}

.faculty-card.level-leader:hover {
    border-color: #6b46c1;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    box-shadow: 0 12px 35px rgba(128, 90, 213, 0.25);
}

/* Teacher Cards */
.faculty-card.teacher {
    border-color: #38a169;
    background: linear-gradient(135deg, #fff 0%, #f0fff4 100%);
    box-shadow: 0 8px 25px rgba(56, 161, 105, 0.15);
}

.faculty-card.teacher:hover {
    border-color: #2f855a;
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    box-shadow: 0 12px 35px rgba(56, 161, 105, 0.25);
}

/* Faculty Photo */
.faculty-photo {
    margin-bottom: 1rem;
}

.faculty-photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Faculty Info */
.faculty-info h4 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.faculty-title {
    font-size: 1rem;
    color: #667eea;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.faculty-department {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 0.3rem;
}

.faculty-subject {
    font-size: 0.9rem;
    color: #95a5a6;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .faculty-org-chart {
        padding: 1rem;
    }
    
    .coordinator-level {
        gap: 1rem;
    }
    
    .teacher-cards {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .article-container {
        padding: 2rem 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .department-title {
        font-size: 1.6rem;
    }
    
    .coordinator-level {
        flex-direction: column;
        align-items: center;
    }
    
    .level-leaders {
        flex-direction: column;
        align-items: center;
    }
    
    .faculty-card.coordinator {
        min-width: 280px;
        max-width: 350px;
    }
    
    .faculty-card.level-leader {
        min-width: 280px;
        max-width: 350px;
    }
    
    .teacher-cards {
        grid-template-columns: 1fr;
    }
    
    .grade-label {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .department-title {
        font-size: 1.4rem;
    }
    
    .faculty-card {
        padding: 1rem;
    }
    
    .faculty-photo img {
        width: 60px;
        height: 60px;
    }
    
    .faculty-info h4 {
        font-size: 1rem;
    }
    
    .faculty-title {
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .hero-section {
        height: auto;
        min-height: auto;
        padding: 2rem;
        background: #f8f9fa !important;
        color: #000 !important;
    }
    
    .department-section {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        margin-bottom: 2rem;
    }
    
    .department-header {
        background: #f8f9fa !important;
        color: #000 !important;
    }
    
    .faculty-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .back-btn {
        display: none;
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.department-section {
    animation: fadeInUp 0.6s ease-out;
}

.department-section:nth-child(2) { animation-delay: 0.1s; }
.department-section:nth-child(3) { animation-delay: 0.2s; }
.department-section:nth-child(4) { animation-delay: 0.3s; }
.department-section:nth-child(5) { animation-delay: 0.4s; }

/* ========================================
   ADMIN INTERFACE STYLES
   ======================================== */

/* Notification animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.modal .close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal .close:hover {
    color: #000;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #f1f1f1;
    color: #333;
}

.btn-secondary:hover {
    background: #ddd;
}

/* Admin controls */
.admin-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

/* Faculty action buttons */
.faculty-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.faculty-card:hover .faculty-actions {
    opacity: 1;
}

.btn-edit,
.btn-delete,
.btn-edit-dept {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-edit,
.btn-edit-dept {
    background: #2196F3;
    color: white;
}

.btn-edit:hover,
.btn-edit-dept:hover {
    background: #0b7dda;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #da190b;
}

.faculty-card {
    position: relative;
}

.department-header {
    position: relative;
}

.btn-edit-dept {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
}

.empty-state a:hover {
    text-decoration: underline;
}