/* Стилове за team.php. Изнесени от inline <style>, за да се кешират. */

        html {
            scroll-behavior: smooth;
        }
        
        .page-header {
            background: linear-gradient(180deg, #2E5AAC 0%, #4B8BF5 100%);
            color: #1A365D;
            padding: 10px 0;
            text-align: center;
        }
        
        .page-header h1 {
            font-size: 3rem;
            font-weight: var(--font-weight-bold);
            margin-bottom: 0.5px;
            color: var(--primary-blue);
            text-shadow:
                -1px -1px 0 white,
                1px -1px 0 white,
                -1px 1px 0 white,
                1px 1px 0 white;
        }
        
        .page-header p {
            font-size: 1.2rem;
            opacity: 0.9;
            font-weight: bold;
            color: white;
        }
        
        .team-section {
            padding: 20px 0;
        }
        
        /* Учителската секция и останалите групи ползват пълната ширина на сайта
           (1600px). Преди тук имаше margin 450px от двете страни, които свиваха
           съдържанието до ~1000px и държаха по 3 карти на ред. */
        .team-section .container {
            max-width: var(--container-max-width);
        }
        
        .team-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 20px;
            margin-top: 2px;
            justify-content: start;
        }
        
        /* Center cards for small groups like management and administrative */
        .team-grid.centered {
            justify-content: center;
            grid-template-columns: repeat(auto-fit, 200px);
            max-width: 1200px;
            margin-left: auto;
            margin-right: auto;
        }
        
        /* Responsive grid */
        @media (max-width: 1400px) {
            .team-grid {
                grid-template-columns: repeat(5, 1fr);
                gap: 20px;
            }
        }
        
        @media (max-width: 1200px) {
            .team-grid {
                grid-template-columns: repeat(4, 1fr);
                gap: 20px;
            }
        }
        
        @media (max-width: 900px) {
            .team-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 20px;
            }
        }
        
        @media (max-width: 768px) {
            /* Fix hero section position on mobile */
            .page-header {
                padding-top: 10px;
            }

            /* Reduce font sizes for mobile */
            .page-header h1 {
                font-size: 2rem !important;
            }







h2[style*="font-size: 2.8rem"] {
                font-size: 2rem !important;
            }

            /* Mobile team cards - vertical stack */
            div[style*="display: flex"][style*="justify-content: center"] {
                flex-direction: column !important;
                align-items: stretch !important;
            }

            div[style*="display: grid"] {
                display: flex !important;
                flex-direction: column !important;
                gap: 15px !important;
            }

            div[style*="margin-right: 100px"] {
                margin-right: 0 !important;
                margin-bottom: 20px !important;
            }

            .team-card {
                width: 100% !important;
                max-width: 100% !important;
                display: flex !important;
                flex-direction: row !important;
                align-items: center !important;
                padding: 12px !important;
            }

            .team-photo {
                width: 80px !important;
                height: 80px !important;
                min-width: 80px !important;
                margin-right: 15px !important;
            }

            .team-info {
                flex: 1 !important;
                text-align: left !important;
            }

            .team-name {
                font-size: 1rem !important;
                margin-bottom: 4px !important;
            }

            .team-role {
                font-size: 0.85rem !important;
            }

            h3[style*="font-size: 1.4rem"] {
                font-size: 1.2rem !important;
            }

            .team-grid {
                grid-template-columns: 1fr !important;
                gap: 20px;
                justify-content: stretch !important;
            }

            /* Reset margins on mobile */
            .team-section .container {
                margin-left: 20px !important;
                margin-right: 20px !important;
            }

            /* Make team cards horizontal layout on mobile */
            .team-card {
                padding: 12px !important;
                margin: 8px 0 !important;
                display: flex !important;
                align-items: center !important;
                gap: 12px !important;
            }

            .team-photo {
                width: 80px !important;
                height: 80px !important;
                margin: 0 !important;
                flex-shrink: 0 !important;
                border-radius: 8px !important;
                overflow: hidden !important;
            }

            .team-info {
                flex: 1 !important;
                text-align: left !important;
            }

            .team-name {
                font-size: 0.95rem !important;
                margin-bottom: 4px !important;
                line-height: 1.2 !important;
            }

            .team-role {
                font-size: 0.8rem !important;
                margin-bottom: 0 !important;
                line-height: 1.2 !important;
            }

            /* Override inline grid styles for paired subjects in mobile */
            div[style*="grid-template-columns: 1fr 1fr"] {
                display: block !important;
            }

            div[style*="grid-template-columns: 1fr 1fr"] > div {
                margin-bottom: 30px !important;
            }

            /* Force all team cards to full width in mobile */
            .team-card {
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 auto !important;
            }

            /* Override any inline grid styles that set fixed widths */
            div[style*="grid-template-columns: repeat(auto-fit, 250px)"] {
                grid-template-columns: 1fr !important;
                justify-content: stretch !important;
            }
        }
        
        .team-card {
            background: var(--white);
            border-radius: var(--border-radius-lg);
            overflow: hidden;
            /* 3D: същият ефект като на панелите по катедри */
            box-shadow:
                0 1px 0 rgba(255, 255, 255, .9) inset,
                0 2px 3px rgba(26, 54, 93, .08),
                0 10px 18px rgba(26, 54, 93, .12),
                0 26px 40px rgba(26, 54, 93, .16);
            transition: transform .3s ease, box-shadow .3s ease;
            position: relative;
            border: 3px solid var(--primary-green);
            width: 200px;
            max-width: 200px;
        }
        
        .team-card:hover {
            transform: translateY(-4px);
            box-shadow:
                0 1px 0 rgba(255, 255, 255, .9) inset,
                0 4px 6px rgba(26, 54, 93, .10),
                0 18px 26px rgba(26, 54, 93, .16),
                0 40px 60px rgba(26, 54, 93, .22);
        }
        
        .team-photo {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--light-gray), var(--gray));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.2rem;
            color: var(--primary-blue);
            position: relative;
            overflow: hidden;
            margin: 15px auto 15px;
        }

        .team-photo img {
            position: absolute !important;
            top: 50% !important;
            left: 50% !important;
            width: auto !important;
            height: auto !important;
            min-width: 120px !important;
            min-height: 120px !important;
            max-width: 360px !important;
            max-height: 360px !important;
            object-fit: contain !important;
            transform-origin: center center !important;
            user-select: none;
            -webkit-user-drag: none;
        }
        
        .team-info {
            padding: 15px;
            text-align: center;
        }
        
        .team-name {
            font-size: 1rem;
            font-weight: var(--font-weight-bold);
            color: var(--primary-blue);
            margin-bottom: 6px;
        }
        
        .team-role {
            color: var(--primary-green);
            font-weight: var(--font-weight-semibold);
            margin-bottom: 10px;
            font-size: 0.85rem;
        }
        
        /* Featured member styles */
        .team-card.featured {
            border: 3px solid gold;
            position: relative;
        }
        
        .team-card.featured::before {
            content: '⭐';
            position: absolute;
            top: 10px;
            right: 10px;
            background: gold;
            color: white;
            padding: 5px 8px;
            border-radius: 20px;
            font-size: 0.8rem;
            z-index: 1;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }
        
        /* Водещите (с жълта рамка) ползват същия ефект при посочване */


/* ---- Учители по катедри: всяка катедра е ред, центриран ----
   Картите са 200px; контейнерът е 1560px, което събира по 7 на ред.
   Непълният последен ред е в средата, не отляво. */
.team-depts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 22px;
    max-width: 1560px;
    margin: 0 auto;
}
/* Всяка катедра е блок с ширина според картите си; малките блокове
   (1-2 учителя) се нареждат един до друг, големите заемат ред. */
.team-dept {
    min-width: 260px;
    max-width: 100%;
    position: relative;
    background: linear-gradient(180deg, #e6f6ec 0%, #c4e8d0 50%, #f4fbf6 100%);
    border-radius: 18px;
    padding: 22px 24px 26px 26px;
    /* 3D: няколко слоя сянка, по-дълбоки отдолу, и повдигане при посочване */
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 2px 3px rgba(26, 54, 93, .08),
        0 10px 18px rgba(26, 54, 93, .12),
        0 26px 40px rgba(26, 54, 93, .16);
    transition: transform .3s ease, box-shadow .3s ease;
    overflow: hidden;
}
.team-dept:hover {
    transform: translateY(-4px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 4px 6px rgba(26, 54, 93, .10),
        0 18px 26px rgba(26, 54, 93, .16),
        0 40px 60px rgba(26, 54, 93, .22);
}
.team-dept .team-row {
    margin: 0;
    gap: 16px;
}
.team-dept-title {
    color: var(--primary-green);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-left: 4px;
    text-align: left;
}
.team-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1560px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .team-dept-title {
        font-size: 1.2rem;
    }
    .team-depts {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }
    .team-dept {
        min-width: 0;
        width: 100%;
        padding: 18px 16px 20px;
    }
}
