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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

.header-with-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.school-logo {
    max-width: 250px;
    width: 100%;
    height: auto;
}

h1 {
    font-size: 1.8rem;
    color: #003366;
    margin-bottom: 5px;
    font-weight: 700;
}

h2 {
    font-size: 1.3rem;
    color: #006633;
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1rem;
}

/* Language Selector */
.language-selector {
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.language-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.lang-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.95rem;
}

.required {
    color: #e74c3c;
}

.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

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

textarea {
    resize: vertical;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Show print-only notes section ALWAYS (for debugging) */
.print-only-notes {
    display: block !important;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 3px solid #667eea;
}

.print-only-notes h3 {
    color: #667eea;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

#printNotesContent {
    padding: 15px !important;
    background: #f0f0f0 !important;
    border: 2px solid #667eea !important;
    min-height: 80px !important;
    white-space: pre-wrap !important;
    font-family: monospace !important;
    color: #000 !important;
    line-height: 1.5 !important;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.success-message {
    text-align: center;
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

.success-message h2 {
    color: #27ae60;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.success-message p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.error-message-box {
    background: #ffe5e5;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    animation: shake 0.5s ease-in-out;
}

.error-message-box h3 {
    color: #e74c3c;
    margin-bottom: 10px;
}

.error-message-box p {
    color: #666;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.hidden {
    display: none !important;
}

/* Admin Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.stat-card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    flex: 1;
    min-width: 200px;
}

.requests-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.requests-table thead {
    background: #667eea;
    color: white;
}

.requests-table th,
.requests-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.requests-table th {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.requests-table tbody tr {
    transition: background 0.2s ease;
    cursor: pointer;
}

.requests-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-in-progress {
    background: #cfe2ff;
    color: #084298;
}

.status-scheduled {
    background: #d1e7dd;
    color: #0f5132;
}

.status-completed {
    background: #e2e3e5;
    color: #383d41;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
    color: #667eea;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #333;
}

.detail-row {
    margin-bottom: 20px;
}

.detail-row strong {
    display: block;
    color: #667eea;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.detail-row p {
    color: #333;
    line-height: 1.6;
}

.teachers-list {
    list-style: none;
    padding: 0;
}

.teachers-list li {
    background: #f8f9fa;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
}

.notes-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.notes-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.btn-save {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-save:hover {
    background: #229954;
    transform: translateY(-2px);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header-with-logo {
        margin-bottom: 15px;
    }

    .school-logo {
        max-width: 200px;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .filters select,
    .filters input {
        width: 100%;
    }

    .requests-table {
        font-size: 0.85rem;
    }

    .requests-table th,
    .requests-table td {
        padding: 10px;
    }

    /* Make table scrollable on mobile */
    .table-wrapper {
        overflow-x: auto;
    }

    .modal-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

/* Status-based row colors */
.requests-table tbody tr.status-pending-row {
    background: #fff3cd22;
}

.requests-table tbody tr.status-in-progress-row {
    background: #cfe2ff22;
}

.requests-table tbody tr.status-scheduled-row {
    background: #d1e7dd22;
}

.requests-table tbody tr.status-completed-row {
    background: #e2e3e533;
}

.requests-table tbody tr.status-archived-row {
    background: #f8f9fa;
    opacity: 0.7;
}

/* Hover states maintain the color tint */
.requests-table tbody tr.status-pending-row:hover {
    background: #fff3cd44;
}

.requests-table tbody tr.status-in-progress-row:hover {
    background: #cfe2ff44;
}

.requests-table tbody tr.status-scheduled-row:hover {
    background: #d1e7dd44;
}

.requests-table tbody tr.status-completed-row:hover {
    background: #e2e3e555;
}

/* Overdue request highlighting */
.overdue-row {
    background: #fff3cd !important;
    border-left: 4px solid #ff6b6b !important;
}

.overdue-row:hover {
    background: #ffe69c !important;
}

.overdue-badge {
    background: #ff6b6b;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 3px;
}

/* Urgent priority badge */
.urgent-badge {
    background: #ff6b6b;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 3px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Print Styles */
@media print {
    /* Reset everything for print */
    * {
        overflow: visible !important;
    }
    
    /* Hide everything except modal content */
    body * {
        visibility: hidden;
    }
    
    body {
        margin: 0;
        padding: 0;
    }
    
    .modal-content, .modal-content * {
        visibility: visible !important;
    }
    
    .modal-content {
        position: static !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        padding: 15px !important;
        margin: 0 !important;
        transform: none !important;
        background: white !important;
        border: none !important;
        overflow: visible !important;
    }
    
    /* Fix modal positioning */
    .modal {
        position: static !important;
        display: block !important;
        background: none !important;
        overflow: visible !important;
    }
    
    #modalBody {
        overflow: visible !important;
    }
    
    /* Hide buttons and interactive elements when printing */
    .modal-header button,
    .btn-save,
    .close-btn {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Hide the editable notes section controls when printing */
    .notes-section textarea,
    .notes-section select,
    .notes-section input,
    .notes-section button {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Hide the Management section title and form elements */
    .notes-section h3,
    .notes-section .form-group {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* SHOW the print-only notes section */
    .print-only-notes {
        display: block !important;
        visibility: visible !important;
        page-break-inside: avoid !important;
    }
    
    .print-only-notes * {
        display: block !important;
        visibility: visible !important;
    }
    
    .print-only-notes hr {
        border: 2px solid #000 !important;
        margin: 30px 0 20px 0 !important;
    }
    
    .print-only-notes h3 {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
        color: #000 !important;
        font-weight: bold !important;
    }
    
    .print-only-notes div {
        padding: 15px !important;
        background: #eeeeee !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        border: 2px solid #000 !important;
        min-height: 80px !important;
        white-space: pre-wrap !important;
        font-family: 'Courier New', monospace !important;
        color: #000 !important;
        line-height: 1.5 !important;
    }
    
    /* Clean up modal header for print */
    .modal-header {
        border-bottom: 2px solid #000 !important;
        margin-bottom: 20px !important;
    }
    
    .modal-header h2 {
        color: #000 !important;
        font-size: 1.5rem !important;
    }
    
    /* Style detail rows for print */
    .detail-row {
        page-break-inside: avoid;
        margin-bottom: 12px !important;
        padding: 5px 0 !important;
    }
    
    .detail-row strong {
        color: #000 !important;
        font-weight: bold !important;
        display: block !important;
        margin-bottom: 3px !important;
    }
    
    .detail-row p,
    .detail-row a {
        color: #000 !important;
        margin: 0 !important;
    }
    
    /* Add Somerset Academy header to print */
    .modal-content::before {
        content: "Somerset Academy Bethany - Parent-Teacher Conference Request";
        display: block !important;
        font-size: 14pt !important;
        font-weight: bold !important;
        color: #000 !important;
        text-align: center !important;
        margin-bottom: 15px !important;
        padding-bottom: 10px !important;
        border-bottom: 3px solid #000 !important;
    }
    
    /* Ensure teachers list prints nicely */
    .teachers-list {
        padding-left: 20px !important;
        margin: 5px 0 !important;
    }
    
    .teachers-list li {
        background: none !important;
        padding: 3px 0 !important;
        border: none !important;
        page-break-inside: avoid !important;
        color: #000 !important;
        list-style: disc !important;
    }
}
