/* Common Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* School Header Styles */
.school-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.school-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.logo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.school-info .school-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.school-info .school-tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    text-align: right;
}

.welcome-message {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.username {
    font-weight: 600;
    color: #ffd700;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: capitalize;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.logout-icon {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-left {
        flex-direction: column;
        text-align: center;
    }

    .school-info .school-name {
        font-size: 1.5rem;
    }

    .header-right {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Modal
 Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(1px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-dialog {
    transform: scale(1);
}

.modal-content {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: black;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Modal Form Styles */
.modal-form {
    margin: 0;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h4,
.form-section h5 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-input,
.form-select {
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-outline {
    background: transparent;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.btn-outline:hover {
    background: #f7fafc;
    border-color: #a0aec0;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.btn-info {
    background: #3182ce;
    color: white;
}

.btn-info:hover {
    background: #2c5282;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0fff4;
    border-color: #9ae6b4;
    color: #22543d;
}

.alert-danger {
    background-color: #fed7d7;
    border-color: #feb2b2;
    color: #742a2a;
}

.alert-info {
    background-color: #ebf8ff;
    border-color: #90cdf4;
    color: #2a4365;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background-color: #c6f6d5;
    color: #22543d;
}

.badge-warning {
    background-color: #faf089;
    color: #744210;
}

.badge-danger {
    background-color: #fed7d7;
    color: #742a2a;
}

.badge-info {
    background-color: #bee3f8;
    color: #2a4365;
}

.badge-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-dialog {
        max-width: 95vw;
        margin: 1rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

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

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* 
Parent-Student Assignment Modal Specific Styles */
.parent-info,
.student-info {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.current-assignments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.assignment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #edf2f7;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.relationship-type {
    font-size: 0.8rem;
    color: #4a5568;
    font-style: italic;
}

.students-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.student-item:last-child {
    border-bottom: none;
}

.student-item:hover {
    background: #f7fafc;
}

.student-item .student-info {
    background: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.student-item .student-info strong {
    display: block;
    color: #2d3748;
}

.student-item .student-info small {
    display: block;
    color: #718096;
    font-size: 0.8rem;
}

.search-form {
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #718096;
}

.empty-state p {
    margin: 0;
}

/* Children list in parent table */
.children-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.child-tag {
    background: #bee3f8;
    color: #2a4365;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.text-muted {
    color: #718096;
    font-style: italic;
}

/* 
Header Center - Dashboard Navigation */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.breadcrumb-nav {
    display: none;
    /* Hidden by default, shown by JavaScript */
    align-items: center;
    gap: 0.5rem;
}

.dashboard-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.dashboard-link i {
    font-size: 1rem;
    opacity: 0.9;
}

.dashboard-link span {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Enhanced School Info */
.school-info .school-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ffffff, #f0f8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.school-info .school-tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-center {
        order: -1;
        width: 100%;
    }

    .breadcrumb-nav {
        justify-content: center;
    }

    .dashboard-link {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .school-info .school-name {
        font-size: 1.4rem;
        text-align: center;
    }

    .school-info .school-tagline {
        text-align: center;
    }

    .header-right {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .header-left {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .dashboard-link span {
        display: none;
    }

    .dashboard-link {
        padding: 0.5rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
    }
}

/* Curren
t Section Display */
.current-section {
    display: none;
    /* Hidden by default, shown by JavaScript */
    margin-left: 2rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
}

/* Enhanced Header Layout */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/* Improved responsive design for header center */
@media (max-width: 768px) {
    .header-center {
        flex-direction: column;
        gap: 0.5rem;
    }

    .current-section {
        margin-left: 0;
        padding: 0.25rem 0.75rem;
    }

    .section-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .current-section {
        display: none !important;
        /* Hide section name on very small screens */
    }
}

/*
 Modal Open Body State */
/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

/* Global Form Responsiveness */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-dialog {
        width: 95% !important;
        margin: 10px auto !important;
        max-height: 95vh !important;
    }

    .modal-body {
        padding: 1rem !important;
    }

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

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

/* Utility Classes for Visibility */
.hide-mobile {
    @media (max-width: 768px) {
        display: none !important;
    }
}

.show-mobile {
    display: none;

    @media (max-width: 768px) {
        display: block !important;
    }
}

/* Enhanced Modal Visibility */
.modal {
    z-index: 1050;
}

.modal.active {
    display: flex !important;
}

/* Debug styles for modal issues */
.modal-debug {
    border: 2px solid red !important;
    background: rgba(255, 0, 0, 0.1) !important;
}