/* ===== TEACHERS PAGE STYLES ===== */

/* ===== CSS RESET & BASE STYLES ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a2e;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin-top: 112px; /* Account for fixed navbar */
}

/* ===== PAGE HEADER ===== */
.page-header {
    position: relative;
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2a63 0%, #143b82 100%);
    overflow: hidden;
}

.page-header-bg {
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1588072432836-e10032774350?w=1600') center/cover no-repeat;
    opacity: 0.15;
}

.page-header-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 42, 99, 0.9) 0%, rgba(15, 42, 99, 0.7) 100%);
}

.page-header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    max-width: 800px;
}

.page-header-content h1 {
    font-size: 56px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.page-header-content p {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== BREADCRUMB ===== */
.breadcrumb-nav {
    background: #f8fafc;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}

.breadcrumb-nav .container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 24px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.breadcrumb li a {
    color: #0f2a63;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.breadcrumb li a:hover {
    color: #c62828;
}

.breadcrumb li.current {
    color: #1a1a2e;
    font-weight: 600;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    color: #9ca3af;
}

/* ===== UTILITIES ===== */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
    font-size: 13px;
    font-weight: 600;
    border-radius: 25px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-label {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(15, 42, 99, 0.08);
    color: #0f2a63;
    font-size: 13px;
    font-weight: 700;
    border-radius: 25px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 42px;
    font-weight: 700;
    color: #0f2a63;
    margin-bottom: 16px;
}

.section-header .subtitle {
    font-size: 18px;
    color: #6b7280;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: #c62828;
    color: #ffffff;
    border-color: #c62828;
}

.btn-primary:hover {
    background: #a51616;
    border-color: #a51616;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(198, 40, 40, 0.3);
}

/* ===== TEACHERS SECTION ===== */
.teachers-section {
    padding: 80px 0 100px;
    background: #ffffff;
}

/* ===== TEACHERS GRID - 4 CARDS PER ROW ===== */
.teachers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

/* ===== TEACHER CARD ===== */
.teacher-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 42, 99, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.teacher-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(15, 42, 99, 0.15);
    border-color: #c62828;
}

.teacher-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.teacher-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.teacher-card:hover .teacher-image img {
    transform: scale(1.05);
}

.teacher-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 42, 99, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.teacher-card:hover .teacher-overlay {
    opacity: 1;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f2a63;
    text-decoration: none;
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

.teacher-card:hover .social-links a {
    transform: translateY(0);
    opacity: 1;
}

.teacher-card:hover .social-links a:nth-child(1) {
    transition-delay: 0.1s;
}

.teacher-card:hover .social-links a:nth-child(2) {
    transition-delay: 0.2s;
}

.social-links a:hover {
    background: #c62828;
    color: #ffffff;
}

.teacher-content {
    padding: 24px;
    text-align: center;
}

.teacher-role {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 12px;
}

.teacher-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f2a63;
    margin-bottom: 12px;
}

.teacher-subjects {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    text-align: left;
}

.teacher-subjects strong {
    color: #0f2a63;
    font-weight: 600;
}

/* ===== TEACHERS CTA ===== */
.teachers-cta {
    text-align: center;
    padding: 48px;
    background: linear-gradient(135deg, #0f2a63, #143b82);
    border-radius: 20px;
    margin-top: 40px;
}

.teachers-cta h3 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.teachers-cta p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    margin: 0 auto 24px;
    line-height: 1.7;
}

/* ===== SCROLL TO TOP ===== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #c62828;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: #a51616;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(198, 40, 40, 0.3);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet - 2 cards per row */
@media (max-width: 1200px) {
    .teachers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large tablet - 2 cards per row */
@media (max-width: 992px) {
    .teachers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .page-header-content h1 {
        font-size: 44px;
    }

    .section-header h2 {
        font-size: 36px;
    }
}

/* Mobile - Horizontal scroll with 3 cards visible */
@media (max-width: 768px) {
    .teachers-grid {
        display: flex;
        gap: 20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 20px 0;
        margin: 0 -24px 60px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .teachers-grid::-webkit-scrollbar {
        display: none;
    }

    .teacher-card {
        flex: 0 0 calc(33.333% - 14px);
        scroll-snap-align: start;
        min-width: 250px;
    }

    .page-header {
        min-height: 35vh;
    }

    .page-header-content h1 {
        font-size: 36px;
    }

    .page-header-content p {
        font-size: 16px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .section-header .subtitle {
        font-size: 16px;
    }

    .teachers-cta {
        padding: 32px 24px;
    }

    .teachers-cta h3 {
        font-size: 24px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .teacher-card {
        flex: 0 0 calc(85% - 10px);
        min-width: 220px;
    }

    .page-header-content h1 {
        font-size: 28px;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .container {
        padding: 0 16px;
    }

    .teachers-grid {
        margin: 0 -16px 40px;
    }
}

/* ===== ANIMATION UTILITIES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.teacher-card {
    animation: fadeInUp 0.6s ease forwards;
}

.teacher-card:nth-child(1) { animation-delay: 0.1s; }
.teacher-card:nth-child(2) { animation-delay: 0.15s; }
.teacher-card:nth-child(3) { animation-delay: 0.2s; }
.teacher-card:nth-child(4) { animation-delay: 0.25s; }
.teacher-card:nth-child(5) { animation-delay: 0.3s; }
.teacher-card:nth-child(6) { animation-delay: 0.35s; }
.teacher-card:nth-child(7) { animation-delay: 0.4s; }
.teacher-card:nth-child(8) { animation-delay: 0.45s; }
.teacher-card:nth-child(9) { animation-delay: 0.5s; }
.teacher-card:nth-child(10) { animation-delay: 0.55s; }
.teacher-card:nth-child(11) { animation-delay: 0.6s; }
.teacher-card:nth-child(12) { animation-delay: 0.65s; }
.teacher-card:nth-child(13) { animation-delay: 0.7s; }
.teacher-card:nth-child(14) { animation-delay: 0.75s; }
.teacher-card:nth-child(15) { animation-delay: 0.8s; }
.teacher-card:nth-child(16) { animation-delay: 0.85s; }
.teacher-card:nth-child(17) { animation-delay: 0.9s; }
.teacher-card:nth-child(18) { animation-delay: 0.95s; }
.teacher-card:nth-child(19) { animation-delay: 1s; }
.teacher-card:nth-child(20) { animation-delay: 1.05s; }
.teacher-card:nth-child(21) { animation-delay: 1.1s; }
.teacher-card:nth-child(22) { animation-delay: 1.15s; }
.teacher-card:nth-child(23) { animation-delay: 1.2s; }
.teacher-card:nth-child(24) { animation-delay: 1.25s; }
.teacher-card:nth-child(25) { animation-delay: 1.3s; }
.teacher-card:nth-child(26) { animation-delay: 1.35s; }
.teacher-card:nth-child(27) { animation-delay: 1.4s; }

/* ===== PREVENT HORIZONTAL SCROLL ===== */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ===== SEARCH AND FILTER SECTION ===== */
.teachers-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.search-box input:focus {
    outline: none;
    border-color: #0f2a63;
    box-shadow: 0 0 0 3px rgba(15, 42, 99, 0.1);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #0f2a63;
    color: #0f2a63;
}

.filter-btn.active {
    background: #0f2a63;
    border-color: #0f2a63;
    color: #ffffff;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.view-btn:hover {
    border-color: #0f2a63;
    color: #0f2a63;
}

.view-btn.active {
    background: #0f2a63;
    border-color: #0f2a63;
    color: #ffffff;
}

.results-count {
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
    color: #6b7280;
}

/* ===== TEACHER BADGE ===== */
.teacher-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(198, 40, 40, 0.9);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}

.teacher-badge i {
    font-size: 10px;
}

/* ===== NO IMAGE BADGE ===== */
.no-image-badge {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 42, 99, 0.9);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 5;
    white-space: nowrap;
}

.no-image-badge i {
    font-size: 14px;
}

/* Make placeholder images look better */
.teacher-image img[src*="student.png"] {
    object-fit: cover;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e2e8f0 100%);
}

/* ===== TEACHER MODAL ===== */
.teacher-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.teacher-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #ffffff;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.teacher-modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: #ffffff;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f2a63;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #c62828;
    color: #ffffff;
}

.modal-body {
    display: grid;
    grid-template-columns: 300px 1fr;
}

.modal-image {
    height: 100%;
    min-height: 400px;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px 0 0 20px;
}

.modal-info {
    padding: 40px;
}

.modal-role {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 12px;
}

.modal-info h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f2a63;
    margin-bottom: 24px;
}

.modal-subjects,
.modal-contact {
    margin-bottom: 24px;
}

.modal-subjects h3,
.modal-contact h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f2a63;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-subjects h3 i,
.modal-contact h3 i {
    color: #c62828;
}

.modal-subjects p,
.modal-contact p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-subjects p i,
.modal-contact p i {
    color: #0f2a63;
    width: 20px;
}

.modal-contact a {
    color: #0f2a63;
    text-decoration: none;
    transition: color 0.3s ease;
}

.modal-contact a:hover {
    color: #c62828;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-whatsapp {
    background: #25D366;
    color: #ffffff;
    border-color: #25D366;
}

.btn-whatsapp:hover {
    background: #128C7E;
    border-color: #128C7E;
}

/* ===== LIST VIEW ===== */
.teachers-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.teachers-grid.list-view .teacher-card {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    align-items: center;
}

.teachers-grid.list-view .teacher-image {
    height: 180px;
}

.teachers-grid.list-view .teacher-content {
    text-align: left;
    padding: 20px 30px;
}

.teachers-grid.list-view .teacher-subjects {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== RESPONSIVE MODAL ===== */
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-image {
        min-height: 250px;
    }

    .modal-image img {
        border-radius: 20px 20px 0 0;
    }

    .modal-info {
        padding: 24px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .teachers-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .filter-buttons {
        justify-content: center;
    }

    .view-toggle {
        justify-content: center;
    }

    .teachers-grid.list-view .teacher-card {
        grid-template-columns: 1fr;
    }

    .teachers-grid.list-view .teacher-image {
        height: 200px;
    }
}
