/* Teacher Dashboard Styles */
.dashboard-header {
    background: linear-gradient(135deg, #287887 0%, #205172 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-nav .nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.dashboard-nav .nav-link:hover,
.dashboard-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.dashboard-main {
    padding: 2rem 0;
    background-color: #e9ecef;
    min-height: calc(100vh - 80px);
}

.seasonal-page .dashboard-main {
    background: transparent;
}

.seasonal-page .dashboard-main > .container,
.seasonal-page .dashboard-main > .container-fluid {
    position: relative;
    z-index: 1;
}

.dashboard-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 2rem;
}

/* Transparent container for main dashboard page (map area) */
.dashboard-main-page .dashboard-content {
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: none;
}

.welcome-section h1 {
    color: #333;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-section p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

.seasonal-page .welcome-section h1 {
    color: #f8fafc;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.seasonal-page .welcome-section p {
    color: #e2e8f0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #287887 0%, #205172 100%);
    border-radius: 50%;
    color: white;
}

.stat-info h3 {
    color: #333;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.stat-info p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 3rem;
}

.quick-actions h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
}

.action-card:hover {
    border-color: #287887;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
    text-decoration: none;
    color: inherit;
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.action-card h3 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.action-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* Recent Students */
.recent-students h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.students-list {
    display: grid;
    gap: 1rem;
}

.student-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    transition: transform 0.3s ease;
}

.student-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.student-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.student-info h4 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.student-info p {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 0.25rem 0;
}

.payment-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.payment-status.paid {
    background: #d4edda;
    color: #155724;
}

.payment-status.unpaid {
    background: #f8d7da;
    color: #721c24;
}

.student-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-small:hover {
    transform: translateY(-2px);
}

.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.page-header h1 {
    color: #333;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 20px;
    background: linear-gradient(135deg, #287887 0%, #205172 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.header-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Breadcrumb Navigation */
.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb-link {
    color: #287887;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: #205172;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #999;
    font-weight: 300;
}

.breadcrumb-current {
    color: #333;
    font-weight: 500;
}

/* Success and Error Messages */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .student-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .student-actions {
        flex-direction: row;
        justify-content: center;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .header-breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    .welcome-section h1 {
        font-size: 2rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Static Map Pattern Styles */
.static-map-pattern {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 3rem 2rem;
    background: transparent;
    border-radius: 12px;
    margin: 2rem 0;
    position: relative;
    top: -50px;
    /* move up 50px */
    /* ИСПРАВЛЕНО: Убрано смещение влево которое мешало центрированию модальных окон */
    /* left: -50px; */
    /* width: calc(100% + 50px); */
}

.map-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    opacity: 0.8;
    position: relative;
    top: -50px;
}

.map-icon {
    position: absolute;
    width: 110px;
    height: 110px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    text-decoration: none;
    z-index: 1;
}

.map-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.32));
    transition: filter 0.3s ease;
}

.map-icon:hover {
    transform: scale(1.15);
    z-index: 100;
}

/* Stronger shadow on hover */
.map-icon:hover img {
    filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.45));
}

.map-icon-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5aa0 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Individual label tweaks */
.map-icon-student .map-icon-label {
    bottom: -35px !important;
    padding: 6px 18px !important;
    min-width: 80px !important;
}

.map-icon-subjects .map-icon-label {
    bottom: -20px !important;
    padding: 6px 16px !important;
    min-width: 80px !important;
}

.map-icon-grades .map-icon-label {
    bottom: -40px !important;
    left: 60% !important;
    padding: 6px 20px !important;
    min-width: 80px !important;
}

.map-icon-homework .map-icon-label {
    bottom: -25px !important;
    padding: 6px 14px !important;
    min-width: 80px !important;
}

.map-icon-schedule .map-icon-label {
    bottom: -35px !important;
    padding: 6px 12px !important;
    min-width: 80px !important;
}

.map-icon-programs .map-icon-label {
    bottom: -35px !important;
    padding: 6px 16px !important;
    min-width: 80px !important;
}

.map-icon-board .map-icon-label {
    bottom: -25px !important;
    padding: 6px 10px !important;
    min-width: 80px !important;
}

/* Icon positions on the map */
.map-icon-student {
    top: -2%;
    left: 18%;
}

.map-icon-subjects {
    top: 3%;
    left: 74%;
    margin-left: -45px;
}

.map-icon-grades {
    top: 28%;
    right: 61%;
}

.map-icon-homework {
    top: 41%;
    left: 60%;
    margin-top: -45px;
}

.map-icon-schedule {
    top: 76%;
    right: 19%;
    margin-top: -45px;
}

.map-icon-programs {
    bottom: 20%;
    left: 18%;
}

.map-icon-board {
    bottom: -2%;
    right: 44%;
}

/* Responsive adjustments for map pattern */
@media (max-width: 768px) {
    .static-map-pattern {
        min-height: 300px;
        padding: 2rem 1rem;
    }

    .map-svg {
        max-width: 100%;
    }
}

/* =================================================================
   Protected map modal styles (scoped with .map-modal)
   ================================================================= */

/* Base container */
.map-icon .map-modal {
    display: none !important;
    position: absolute !important;
    z-index: 10000 !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
    padding: 0;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-top: 10px !important;
}

.map-icon .map-modal.show,
.map-icon .map-modal[style*="display: block"] {
    display: block !important;
    animation: mapModalPopIn 0.2s ease-out !important;
}

@keyframes mapModalPopIn {
    from {
        opacity: 0 !important;
        transform: translateX(-50%) scale(0.8) !important;
    }

    to {
        opacity: 1 !important;
        transform: translateX(-50%) scale(1) !important;
    }
}

@keyframes mapModalPopInLeftSide {
    from {
        opacity: 0 !important;
        transform: translateY(-10%) scale(0.8) !important;
    }

    to {
        opacity: 1 !important;
        transform: translateY(-10%) scale(1) !important;
    }
}

@keyframes mapModalPopInRightSide {
    from {
        opacity: 0 !important;
        transform: translateY(-10%) scale(0.8) !important;
    }

    to {
        opacity: 1 !important;
        transform: translateY(-10%) scale(1) !important;
    }
}

@keyframes mapModalPopInTop {
    from {
        opacity: 0 !important;
        transform: translateX(-50%) translateY(-20px) !important;
    }

    to {
        opacity: 1 !important;
        transform: translateX(-50%) translateY(0) !important;
    }
}

/* Modal content */
.map-icon .map-modal-content {
    background-color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-shadow: none !important;
    display: block !important;
    font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.map-icon .map-modal-header {
    background: linear-gradient(135deg, #287887 0%, #205172 100%) !important;
    color: white !important;
    padding: 12px 15px !important;
    border-radius: 10px 10px 0 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.map-icon .map-modal-header h3 {
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: white !important;
}

.map-icon .map-modal-close {
    font-size: 20px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: color 0.3s ease !important;
    line-height: 1 !important;
    color: white !important;
    background: none !important;
    border: none !important;
}

.map-icon .map-modal-close:hover {
    color: #ddd !important;
}

.map-icon .map-modal-body {
    padding: 12px !important;
    overflow: visible !important;
    display: block !important;
}

.map-icon .map-modal-buttons {
    display: grid !important;
    gap: 6px !important;
    grid-template-columns: 1fr !important;
    overflow: visible !important;
}

.map-icon .map-modal-btn {
    padding: 8px 10px !important;
    background: white !important;
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.map-icon-homework .map-modal-btn {
    padding: 5px 6px !important;
    font-size: 10px !important;
    gap: 4px !important;
}

.map-icon-homework .map-modal-buttons {
    gap: 4px !important;
}

.map-icon .map-modal-btn:hover {
    background: linear-gradient(135deg, #287887 0%, #205172 100%) !important;
    color: white !important;
    border-color: #287887 !important;
    transform: translateX(3px) !important;
}

.map-icon .map-modal-btn i {
    font-size: 12px !important;
    width: 12px !important;
    text-align: center !important;
    display: inline-block !important;
}

/* Positioning of map modals per icon */
.map-icon-student .map-modal {
    top: 0 !important;
    left: 120% !important;
    transform: translateY(-10%) !important;
    width: 180px !important;
    animation: mapModalPopInRightSide 0.3s ease-out !important;
}

.map-icon-subjects .map-modal {
    top: 0 !important;
    left: -180px !important;
    transform: translateY(-10%) !important;
    width: 160px !important;
    animation: mapModalPopInLeftSide 0.3s ease-out !important;
}

.map-icon-grades .map-modal {
    top: 0 !important;
    left: 120% !important;
    transform: translateY(-10%) !important;
    width: 160px !important;
    animation: mapModalPopInRightSide 0.3s ease-out !important;
}

.map-icon-homework .map-modal {
    top: 0 !important;
    left: -210px !important;
    transform: translateY(-10%) !important;
    width: 190px !important;
    animation: mapModalPopInLeftSide 0.3s ease-out !important;
}

.map-icon-schedule .map-modal {
    top: 0 !important;
    left: -210px !important;
    transform: translateY(-10%) !important;
    width: 180px !important;
    animation: mapModalPopInLeftSide 0.3s ease-out !important;
}

.map-icon-programs .map-modal {
    top: 0 !important;
    left: 120% !important;
    transform: translateY(-10%) !important;
    width: 190px !important;
    animation: mapModalPopInRightSide 0.3s ease-out !important;
}

.map-icon-board .map-modal {
    top: -130px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 160px !important;
    animation: mapModalPopInTop 0.3s ease-out !important;
}

@media (max-width: 768px) {
    .map-icon .map-modal-content {
        margin: 5% auto !important;
        width: 95% !important;
    }

    .map-icon .map-modal-body {
        padding: 20px !important;
    }

    .map-icon .map-modal-btn {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
}
