/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}/* Base Styles */
:root {
    --primary-color: #F37021; /* KMITL Orange */
    --secondary-color: #FF9F55;
    --accent-color: #f6b93b;
    --light-color: #f5f6fa;
    --dark-color: #45494f;
    --success-color: #4cd137;
    --warning-color: #e1b12c;
    --danger-color: #e84118;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

/* Placeholder Styling */
::placeholder {
    color: #aaa;
    opacity: 1;
}

::-webkit-input-placeholder {
    color: #aaa;
}

::-moz-placeholder {
    color: #aaa;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #aaa;
}

/* Future Courses Label - Orange Theme */
.future-courses-label {
    color: var(--primary-color) !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f0f2f5;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

header h1 {
    margin-bottom: 5px;
    font-size: 2.2rem;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Tabs */
.tabs {
    display: flex;
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

/* Tab Content */
.tab-pane {
    display: none;
}

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

/* Cards */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.card h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.card p {
    margin-bottom: 20px;
    color: #666;
}

.card h3 {
    margin: 20px 0 15px;
    font-size: 1.3rem;
    color: var(--primary-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="number"],
select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    color: #888;
    transition: var(--transition);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

input[type="number"]:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 105, 189, 0.2);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3a5bbf;
}

.btn-secondary {
    background-color: #e9ecef;
    color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: #dee2e6;
}

.btn-primary i,
.btn-secondary i {
    margin-right: 5px;
}

/* Course List */
.course-list {
    margin-bottom: 20px;
}

.course-entry {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-end;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
}

.course-entry .input-group {
    margin-bottom: 0;
}

.course-entry .input-group label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.course-entry select {
    width: 120px;
    padding: 11px 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    background-color: #fff;
}

.course-entry .credit-input {
    width: 80px;
    margin-right: 0;
}

.course-entry .remove-course {
    height: 42px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

/* remove-course hover is handled by btn-delete styles */

/* Result Box */
.result-box {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.result-box h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.result-box.warning {
    border-left-color: var(--warning-color);
}

.result-box.danger {
    border-left-color: var(--danger-color);
}

.result-box.success {
    border-left-color: var(--success-color);
}

.hidden {
    display: none;
}

/* Instructions */
.instructions {
    margin-bottom: 20px;
    color: #666;
    font-size: 0.95rem;
}

.instructions p {
    margin-bottom: 5px;
}

/* Course Input Row */
.course-input-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 25px;
    width: 100%;
}

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

.input-group:first-child {
    flex: 1;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    padding: 11px 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.input-group input[type="text"] {
    width: 100%;
}

.input-group input[type="number"] {
    width: 100px;
    font-size: 1.1rem;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

/* Custom number input wrapper */
.number-input-wrapper {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
    height: 42px;
    width: 120px;
}

.number-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(243, 112, 33, 0.15);
}

.number-input-wrapper input {
    border: none !important;
    border-radius: 0 !important;
    flex: 1;
    text-align: left;
    padding-left: 12px;
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

.number-input-wrapper input::-webkit-outer-spin-button,
.number-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
    display: none;
}

.number-input-wrapper input:focus {
    outline: none;
    box-shadow: none !important;
}

.number-input-wrapper .spinner-buttons {
    display: flex;
    flex-direction: column;
    width: 24px;
}

.number-input-wrapper .spinner-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #555;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.number-input-wrapper .spinner-btn svg {
    width: 8px;
    height: 8px;
}

.number-input-wrapper .spinner-btn:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

.number-input-wrapper .spinner-btn:active {
    background: #e5e5e5;
}

.input-group select {
    width: 120px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.btn-add {
    padding: 12px 25px;
    background-color: #3d9970;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 90px;
}

.btn-add:hover {
    background-color: #2d7a5a;
}

.btn-add.btn-update {
    background-color: #ff9f43;
}

.btn-add.btn-update:hover {
    background-color: #e68a2e;
}

/* Courses Table */
.courses-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

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

.courses-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.courses-table td.text-center,
.courses-table th.text-center {
    text-align: center;
}

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

/* Action Buttons */
.btn-edit {
    padding: 6px 14px;
    background-color: #ff9f43;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 6px;
    transition: all 0.2s ease;
}

.btn-edit:hover {
    background-color: #e68a2e;
}

.btn-save {
    padding: 6px 14px;
    background-color: #51cf66;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 6px;
    transition: all 0.2s ease;
}

.btn-save:hover {
    background-color: #40c057;
}

.btn-delete {
    padding: 6px 14px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background-color: #fa5252;
}

.btn-cancel {
    padding: 6px 14px;
    background-color: #868e96;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background-color: #6c757d;
}

/* Edit inputs in table */
.courses-table .edit-name {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.courses-table .edit-credits {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.courses-table .edit-grade {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* GPA Summary */
.gpa-summary {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
}

/* GPA Action Buttons */
.gpa-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.btn-export,
.btn-clear {
    padding: 10px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-export {
    background-color: #4a90d9;
    color: white;
}

.btn-export:hover {
    background-color: #3a7bc8;
}

.btn-clear {
    background-color: #dc3545;
    color: white;
}

.btn-clear:hover {
    background-color: #c82333;
}

/* GPA Display */
.gpa-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin: 20px 0;
}

.gpa-change {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    font-weight: 600;
}

.gpa-change.positive {
    color: var(--success-color);
}

.gpa-change.negative {
    color: var(--danger-color);
}

.gpa-change.neutral {
    color: #777;
}

.gpa-change i {
    margin-right: 5px;
}

/* Insights */
.insight {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    background-color: #fff3cd;
    border-left: 4px solid var(--warning-color);
}

.insight.positive {
    background-color: #d4edda;
    border-left-color: var(--success-color);
}

.insight.negative {
    background-color: #f8d7da;
    border-left-color: var(--danger-color);
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: 600;
}

.progress-bar-outer {
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* About Tab Styles */
.section-container {
    margin-bottom: 30px;
}

.grading-table-container {
    overflow-x: auto;
    margin: 20px 0;
}

.grading-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: var(--box-shadow);
}

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

.grading-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

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

.grading-table tr:hover {
    background-color: #f1f3f5;
}

.feature-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.feature {
    flex: 1 1 calc(33.333% - 20px);
    min-width: 250px;
    display: flex;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.5rem;
}

.feature-content {
    flex: 1;
    padding: 15px;
}

.feature-content h4 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

.formula-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin: 20px 0;
}

.formula-container p {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.formula-note {
    font-size: 0.9rem !important;
    font-weight: normal !important;
    color: #666;
    margin-top: 10px;
}

/* Attribution Styles */
.attribution {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.8rem;
    color: #555;
}

.attribution p {
    margin: 0;
}

.attribution a {
    color: #555;
    text-decoration: none;
    font-weight: normal;
    transition: color 0.2s ease;
}

.attribution a:hover {
    color: #666;
    text-decoration: underline;
}

.timestamp {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

.late-night-message {
    font-style: italic;
    display: none;
}
/* Input validation styles */
input[type="number"].invalid {
    border-color: #e84118;
    background-color: rgba(232, 65, 24, 0.05);
    box-shadow: 0 0 0 1px #e84118;
}

input[type="number"].valid {
    border-color: #4cd137;
}

input[type="number"]:focus.invalid {
    box-shadow: 0 0 0 2px rgba(232, 65, 24, 0.2);
}

input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
    opacity: 1;
}

/* Error tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    right: 15px;
    top: 15px;
    z-index: 1000;
    background-color: var(--dark-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--box-shadow);
}

.mobile-sidebar {
    display: none;
    position: fixed;
    top: 0;
    right: -250px;
    width: 250px;
    height: 100%;
    background-color: white;
    z-index: 999;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    padding-top: 60px;
}

.mobile-sidebar.open {
    right: 0;
}

.mobile-tabs {
    display: flex;
    flex-direction: column;
}

.mobile-tab-button {
    padding: 15px;
    border: none;
    background: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.mobile-tab-button.active {
    background-color: #f5f5f5;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large Desktop (1200px+) - Base styles apply */

/* Laptop / Small Desktop (992px - 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 22px;
    }

    .card h2 {
        font-size: 1.6rem;
    }
}

/* Tablet Landscape (769px - 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 0.9rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-button {
        flex: 1 1 auto;
        min-width: 120px;
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    .card {
        padding: 20px;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    /* Course Input Row - 2x2 grid on tablet landscape */
    .course-input-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .course-input-row .input-group:first-child {
        grid-column: 1 / -1;
    }

    /* Table adjustments */
    .courses-table th,
    .courses-table td {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .grading-table {
        font-size: 0.9rem;
    }

    .feature-container {
        gap: 15px;
    }

    .feature {
        padding: 15px;
    }

    .result-row {
        padding: 10px 0;
        font-size: 1rem;
    }

    .result-row strong {
        font-size: 1.2rem;
    }
}

/* Tablet Portrait (481px - 768px) */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-sidebar {
        display: block;
    }

    .tabs {
        display: none;
    }

    .container {
        padding: 0 15px;
    }

    header {
        padding: 12px 0;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 0.85rem;
    }

    .card {
        padding: 18px;
        margin-bottom: 15px;
    }

    .card h2 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }

    .card h3 {
        font-size: 1.15rem;
    }

    .instructions {
        padding: 12px;
        margin-bottom: 15px;
    }

    .instructions p {
        font-size: 0.9rem;
    }

    /* Course Input Row - Stack on tablet portrait */
    .course-input-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .course-input-row .input-group:first-child {
        grid-column: 1 / -1;
    }

    .input-group label {
        font-size: 0.85rem;
    }

    .btn-add {
        padding: 10px 20px;
    }

    /* Number input wrapper on tablet */
    .number-input-wrapper {
        width: 100%;
        height: 40px;
    }

    .input-group select {
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        padding: 12px 20px;
    }

    /* GPA Display */
    .gpa-display {
        font-size: 1.8rem;
    }

    /* Courses Table */
    .courses-table-container {
        overflow-x: auto;
        margin: 0 -18px;
        padding: 0 18px;
    }

    .courses-table {
        min-width: 500px;
    }

    .courses-table th,
    .courses-table td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .btn-edit,
    .btn-delete,
    .btn-save,
    .btn-cancel {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .gpa-summary {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .gpa-actions {
        flex-direction: column;
        gap: 10px;
    }

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

    /* Form elements */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    /* Result boxes */
    .result-row {
        padding: 10px 0;
        font-size: 0.95rem;
    }

    .result-row strong {
        font-size: 1.15rem;
    }

    .result-explanation {
        padding: 12px;
        font-size: 0.9rem;
    }

    /* About page */
    .grading-table-container {
        overflow-x: auto;
    }

    .feature-container {
        flex-direction: column;
    }

    .feature {
        flex-direction: row;
        text-align: left;
    }

    .feature-icon {
        margin-bottom: 0;
        margin-right: 15px;
    }

    .formula-container {
        padding: 15px;
    }

    .formula-container p {
        font-size: 0.9rem;
    }

    .attribution {
        margin-top: 30px;
        padding-top: 15px;
    }
}

/* Mobile (up to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    header {
        padding: 10px 0;
        margin-bottom: 15px;
    }

    header h1 {
        font-size: 1.3rem;
    }

    header p {
        font-size: 0.8rem;
    }

    .card {
        padding: 15px;
        border-radius: 6px;
    }

    .card h2 {
        font-size: 1.25rem;
        margin-bottom: 10px;
    }

    .card h3 {
        font-size: 1.1rem;
    }

    .card p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .instructions {
        padding: 10px;
        margin-bottom: 12px;
    }

    .instructions p {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    /* Course Input Row - Full stack on mobile */
    .course-input-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .course-input-row .input-group {
        width: 100%;
    }

    .course-input-row .input-group:first-child {
        grid-column: auto;
    }

    .input-group {
        width: 100%;
    }

    .input-group label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .input-group input,
    .input-group select {
        padding: 10px;
        font-size: 0.9rem;
    }

    .btn-add {
        width: 100%;
        padding: 12px;
    }

    /* Number input wrapper on mobile */
    .number-input-wrapper {
        width: 100%;
        height: 42px;
    }

    .input-group select {
        width: 100%;
    }

    /* GPA Display on mobile */
    .gpa-display {
        font-size: 1.6rem;
    }

    /* Table - Card-like layout for very small screens */
    .courses-table {
        min-width: 400px;
    }

    .courses-table th,
    .courses-table td {
        padding: 8px;
        font-size: 0.8rem;
    }

    .courses-table th:first-child,
    .courses-table td:first-child {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .btn-edit,
    .btn-delete,
    .btn-save,
    .btn-cancel {
        padding: 5px 8px;
        font-size: 0.7rem;
    }

    .gpa-summary {
        padding: 12px;
        font-size: 0.9rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .btn-export,
    .btn-clear {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    /* Form elements */
    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 0.9rem;
    }

    /* Result boxes */
    .result-box h3 {
        font-size: 1.1rem;
    }

    .result-row {
        padding: 8px 0;
        font-size: 0.9rem;
    }

    .result-row strong {
        font-size: 1.1rem;
    }

    .result-explanation {
        padding: 10px;
        font-size: 0.85rem;
        line-height: 1.5;
    }

    /* About page */
    .section-container {
        margin-bottom: 20px;
    }

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

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

    .feature {
        padding: 12px;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .feature-content h4 {
        font-size: 1rem;
    }

    .feature-content p {
        font-size: 0.85rem;
    }

    .formula-container {
        padding: 12px;
    }

    .formula-container p {
        font-size: 0.85rem;
    }

    .reference-link {
        font-size: 0.8rem;
    }

    .attribution {
        margin-top: 25px;
        padding-top: 12px;
        font-size: 0.75rem;
    }

    .timestamp {
        font-size: 0.7rem;
    }

    /* Mobile sidebar adjustments */
    .mobile-sidebar {
        width: 260px;
    }

    .mobile-tab-button {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* Simplified Simulator Results */
.gpa-change-text {
    text-align: center;
    color: #666;
    margin: 10px 0 20px;
    font-size: 0.95rem;
}

.gpa-change-text.positive {
    color: #28a745;
}

.gpa-change-text.negative {
    color: #dc3545;
}

.gpa-change-text.neutral {
    color: #666;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 1.05rem;
}

.result-row:last-of-type {
    border-bottom: none;
}

.result-row strong {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.summary-info,
.credits-summary {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.summary-info p,
.credits-summary p {
    margin: 5px 0;
    color: #555;
}

/* Text utility classes */
.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Result explanation text */
.result-explanation {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #555;
    line-height: 1.6;
    text-align: center;
}

/* Reference link */
.reference-link {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
}

.reference-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.reference-link a:hover {
    text-decoration: underline;
}