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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.logo {
    max-width: 120px;
    height: auto;
    background: white;
    padding: 10px;
    border-radius: 10px;
}

header h1 {
    font-size: 2em;
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
}

/* Navigation Tabs */
.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 3px solid #1e3c72;
}

.tab-btn {
    flex: 1;
    padding: 18px 20px;
    background: #e0e0e0;
    border: none;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    color: #555;
    transition: all 0.3s ease;
    border-right: 1px solid #ccc;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: #d0d0d0;
    color: #1e3c72;
}

.tab-btn.active {
    background: white;
    color: #1e3c72;
    border-bottom: 3px solid #1e3c72;
    margin-bottom: -3px;
}

/* Main Content */
main {
    padding: 40px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

h2 {
    color: #1e3c72;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 2px solid #1e3c72;
    padding-bottom: 10px;
}

/* Form Styles */
.form {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

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

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #1e3c72;
}

.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
}

.photo-preview {
    margin-top: 15px;
    text-align: center;
}

.photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 3px solid #1e3c72;
}

/* Course Selection */
.course-selection {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.course-selection label {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.course-selection label:hover {
    background: #f0f0f0;
    border-color: #1e3c72;
}

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

/* Info Box */
.info-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.info-box p {
    margin: 8px 0;
    color: #856404;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 14px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-top: 10px;
}

.btn-primary {
    background: #1e3c72;
    color: white;
}

.btn-primary:hover {
    background: #2a5298;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

/* Output Section */
.output-section {
    margin-top: 40px;
}

.print-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Document Styles */
.document {
    background: white;
    padding: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    min-height: 400px;
}

/* Student ID Card */
.student-card-doc {
    max-width: 500px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
}

.student-card-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid white;
    padding-bottom: 15px;
}

.student-card-header img {
    max-width: 80px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.student-card-header h3 {
    font-size: 1.4em;
    margin: 10px 0 5px 0;
}

.student-card-body {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    align-items: start;
}

.student-photo {
    width: 120px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid white;
}

.student-info p {
    margin: 10px 0;
    font-size: 0.95em;
}

.student-info strong {
    display: block;
    font-size: 0.85em;
    opacity: 0.8;
    margin-bottom: 3px;
}

/* Schedule Document */
.schedule-doc {
    background: white;
    color: #333;
}

.schedule-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #1e3c72;
}

.schedule-header img {
    max-width: 100px;
    background: white;
    padding: 10px;
    border-radius: 8px;
}

.schedule-header h3 {
    color: #1e3c72;
    margin: 15px 0 10px 0;
    font-size: 1.8em;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.schedule-table th,
.schedule-table td {
    border: 2px solid #1e3c72;
    padding: 12px;
    text-align: left;
}

.schedule-table th {
    background: #1e3c72;
    color: white;
    font-weight: 600;
}

.schedule-table tr:nth-child(even) {
    background: #f8f9fa;
}

.schedule-table td input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.schedule-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #1e3c72;
}

.schedule-info p {
    margin: 8px 0;
}

/* Receipt Document */
.receipt-doc {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    color: #333;
}

.receipt-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #1e3c72;
}

.receipt-header img {
    max-width: 100px;
    background: white;
    padding: 10px;
    border-radius: 8px;
}

.receipt-header h3 {
    color: #1e3c72;
    margin: 15px 0;
    font-size: 1.8em;
}

.receipt-info {
    margin-bottom: 30px;
}

.receipt-info-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.receipt-info-row strong {
    color: #555;
}

.receipt-fees {
    margin-top: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.receipt-fees h4 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.fee-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 3px solid #1e3c72;
    font-size: 1.2em;
    font-weight: bold;
    color: #1e3c72;
}

.receipt-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* Footer */
footer {
    background: #1e3c72;
    color: white;
    text-align: center;
    padding: 20px;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
    }

    header, nav, .form, .print-controls, footer {
        display: none !important;
    }

    .tab-content {
        display: block !important;
    }

    .output-section {
        display: block !important;
        margin: 0;
    }

    .document {
        border: none;
        padding: 20px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 1.5em;
    }

    main {
        padding: 20px;
    }

    .tab-btn {
        font-size: 0.9em;
        padding: 12px 10px;
    }

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

    .student-photo {
        margin: 0 auto;
    }

    .receipt-info-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

/* Weekly Timetable Styles */
.timetable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9em;
}

.timetable th,
.timetable td {
    border: 2px solid #1e3c72;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.timetable th {
    background: #1e3c72;
    color: white;
    font-weight: 600;
    padding: 12px 8px;
}

.timetable .time-col {
    width: 80px;
    min-width: 70px;
}

.period-cell {
    background: #f0f4f8;
    font-weight: 600;
    color: #1e3c72;
}

.time-cell {
    background: #f0f4f8;
    font-size: 0.85em;
    color: #555;
    white-space: nowrap;
}

.course-cell {
    padding: 6px !important;
    min-height: 60px;
}

.course-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.course-content strong {
    font-size: 0.85em;
}

.course-short {
    font-size: 0.75em;
    opacity: 0.9;
}

.course-room {
    font-size: 0.7em;
    opacity: 0.8;
    margin-top: 2px;
}

.empty-cell {
    background: #fafafa;
}

/* Schedule Legend */
.schedule-legend {
    margin-top: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1e3c72;
}

.schedule-legend p {
    margin-bottom: 10px;
    color: #1e3c72;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Schedule Only Mode - for screenshots */
body.schedule-only-mode {
    background: white !important;
    padding: 10px !important;
}

body.schedule-only-mode .container {
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
}

body.schedule-only-mode header,
body.schedule-only-mode nav,
body.schedule-only-mode footer,
body.schedule-only-mode .form,
body.schedule-only-mode .print-controls,
body.schedule-only-mode h2,
body.schedule-only-mode #student-card,
body.schedule-only-mode #receipt {
    display: none !important;
}

body.schedule-only-mode main {
    padding: 10px;
}

body.schedule-only-mode #schedule {
    display: block !important;
}

body.schedule-only-mode .output-section {
    margin-top: 0;
}

body.schedule-only-mode .document {
    padding: 20px;
    border: none;
}

body.schedule-only-mode .schedule-header,
body.schedule-only-mode .schedule-info,
body.schedule-only-mode .schedule-legend {
    display: block !important;
}

/* Floating exit button for schedule-only mode */
.floating-exit-btn {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.floating-exit-btn:hover {
    background: #c82333;
}

body.schedule-only-mode .floating-exit-btn {
    display: block !important;
}

/* Toggle button active state */
.btn-secondary.active-mode {
    background: #28a745;
}

.btn-secondary.active-mode:hover {
    background: #218838;
}

/* Responsive Timetable */
@media (max-width: 900px) {
    .timetable {
        font-size: 0.75em;
    }

    .timetable th,
    .timetable td {
        padding: 4px;
    }

    .course-content strong {
        font-size: 0.8em;
    }

    .course-short,
    .course-room {
        display: none;
    }
}
