/* ===============================================
   GPA CALCULATOR - USING MODERNTOOLS UNIFIED THEME
   =============================================== */

/* Use modern tools color scheme */
:root {
    --primary-color: #3B82F6;
    --secondary-color: #10B981;
    --accent-color: #8B5CF6;
    --text-color: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-base: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;    
    --radius-2xl: 1.5rem;
    
    /* Gray color scale for consistency */
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    
    /* GPA specific colors */
    --excellent-color: #10B981; /* A grade */
    --good-color: #3B82F6;      /* B grade */
    --average-color: #F59E0B;   /* C grade */
    --poor-color: #EF4444;      /* D/F grade */
    --warning-color: #F59E0B;
    --success-color: #10B981;
    --danger-color: #EF4444;
    
    /* Aliases for compatibility */
    --brand-primary: var(--primary-color);
    --brand-secondary: var(--secondary-color);
    --text-primary: var(--text-color);
}

/* Dark theme using exact same colors as percentage calculator */
[data-theme="dark"] {
    --text-color: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    
    /* Gray color scale for dark theme */
    --gray-100: #374151;
    --gray-200: #4B5563;
    --gray-300: #6B7280;
    --gray-400: #9CA3AF;
    
    /* Aliases for compatibility */
    --brand-primary: var(--primary-color);
    --brand-secondary: var(--secondary-color);
    --text-primary: var(--text-color);
}

/* Theme-aware background support */
body {
    background: var(--bg-primary);
}

[data-theme="dark"] body {
    background: var(--bg-primary);
}

/* Main Layout */
.main-content {
    min-height: 100vh;
}

/* ===============================================
   HERO SECTION STYLES
   =============================================== */

.tool-hero {
    margin-top: 0;
    padding: 120px 0 80px;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.1) 30%, rgba(16, 185, 129, 0.1) 70%, var(--bg-primary) 100%);
    overflow: hidden;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 3;
}

.hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    border-radius: 50%;
    box-shadow: 
        0 15px 35px rgba(59, 130, 246, 0.4),
        0 0 0 10px rgba(59, 130, 246, 0.1),
        0 0 0 20px rgba(59, 130, 246, 0.05);
    position: relative;
    overflow: hidden;
}

.hero-icon i {
    font-size: 3rem;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===============================================
   CALCULATOR MAIN SECTION
   =============================================== */

.calculator-main {
    padding: 80px 0 120px;
    background: var(--bg-secondary);
}

.calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ===============================================
   CALCULATOR TABS
   =============================================== */

.calculator-tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scroll-behavior: smooth;
}

.tab-button {
    flex: 1;
    min-width: 150px;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-button:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

.tab-button.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* ===============================================
   CALCULATOR CARD
   =============================================== */

.calculator-card {
    padding: 2rem;
}

/* ===============================================
   DISPLAY AREA
   =============================================== */

.calculator-display {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.calculator-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: displayShimmer 3s ease-in-out infinite;
}

@keyframes displayShimmer {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.display-result {
    position: relative;
    z-index: 2;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 3.5rem;
    font-weight: 800;
    display: inline-block;
    margin-right: 0.5rem;
}

.result-unit {
    font-size: 1.5rem;
    font-weight: 500;
    opacity: 0.9;
}

.display-formula {
    position: relative;
    z-index: 2;
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* ===============================================
   ACADEMIC STANDING DISPLAY
   =============================================== */

.academic-standing {
    margin-bottom: 2rem;
}

.standing-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    border: 1px solid var(--border-color);
}

.standing-info, .scholarship-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.standing-label, .scholarship-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.standing-value, .scholarship-value {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-base);
    min-width: 100px;
}

.standing-value.excellent {
    background: var(--excellent-color);
    color: white;
}

.standing-value.good {
    background: var(--good-color);
    color: white;
}

.standing-value.average {
    background: var(--average-color);
    color: white;
}

.standing-value.poor {
    background: var(--poor-color);
    color: white;
}

.scholarship-value.eligible {
    background: var(--success-color);
    color: white;
}

.scholarship-value.not-eligible {
    background: var(--danger-color);
    color: white;
}

/* ===============================================
   INPUT SECTIONS
   =============================================== */

.input-section {
    display: none;
}

.input-section.active {
    display: block;
}

/* ===============================================
   COURSE INPUT FORM
   =============================================== */

.course-input-form {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.course-input-form h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.input-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr auto;
    gap: 1rem;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    background: var(--bg-primary);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.add-course-btn {
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.add-course-btn:hover {
    background: #2563EB;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===============================================
   COURSES LIST
   =============================================== */

.courses-list {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.courses-header {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.courses-header h3 {
    margin: 0;
    color: var(--text-color);
    font-weight: 700;
}

.clear-all-btn {
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--radius-base);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-all-btn:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

.courses-container {
    padding: 1.5rem;
}

.no-courses {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
}

.no-courses i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-courses p {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.no-courses span {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===============================================
   COURSE ITEM
   =============================================== */

.course-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.course-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.course-item:last-child {
    margin-bottom: 0;
}

.course-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.course-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0;
    flex: 1;
}

.course-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.course-remove:hover {
    background: #DC2626;
    transform: scale(1.1);
}

.course-details {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 1rem;
    align-items: center;
}

.course-detail {
    text-align: center;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.grade-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-base);
    font-weight: 700;
    color: white;
    display: inline-block;
}

.grade-a { background: var(--excellent-color); }
.grade-b { background: var(--good-color); }
.grade-c { background: var(--average-color); }
.grade-d, .grade-f { background: var(--poor-color); }

/* ===============================================
   QUICK ACTIONS
   =============================================== */

.quick-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.action-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.save-btn {
    background: var(--secondary-color);
    color: white;
}

.save-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.calculate-btn {
    background: var(--primary-color);
    color: white;
}

.calculate-btn:hover {
    background: #2563EB;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.goal-btn {
    background: var(--accent-color);
    color: white;
}

.goal-btn:hover {
    background: #7C3AED;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===============================================
   CUMULATIVE GPA SECTION
   =============================================== */

.cumulative-input-form {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.cumulative-input-form h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.cumulative-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ===============================================
   GPA GOAL CALCULATOR
   =============================================== */

.gpa-goal-calculator {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.gpa-goal-calculator h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.goal-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.goal-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: none;
}

.goal-result.show {
    display: block;
}

.goal-result h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-weight: 700;
}

.goal-result p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.goal-result .highlight {
    color: var(--primary-color);
    font-weight: 700;
}

/* ===============================================
   HISTORY SECTION
   =============================================== */

.history-container {
    background: var(--bg-primary);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.history-header h3 {
    margin: 0;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.clear-history-btn {
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--radius-base);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-history-btn:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

/* History list items have margin-bottom for spacing */

.no-history {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
}

.no-history i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-history p {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.no-history span {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===============================================
   HISTORY ITEM
   =============================================== */

.history-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-header-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.history-gpa {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.history-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    text-align: center;
}

.history-detail {
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-base);
    border: 1px solid var(--border-color);
}

.history-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.history-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

/* ===============================================
   RESULTS SUMMARY SECTION
   =============================================== */

.results-summary {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-sm);
}

.results-summary h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

.results-summary h3::before {
    content: '📊';
    font-size: 1.125rem;
}

.result-items {
    display: grid;
    gap: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.result-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.result-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-value-item {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
    font-family: 'Inter', monospace;
    text-align: right;
}

/* ===============================================
   QUICK REFERENCE SECTION
   =============================================== */

.quick-reference {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.quick-reference h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
}

.quick-reference h3:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.reference-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reference-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reference-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.reference-item:hover:before {
    opacity: 1;
}

.reference-item h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.reference-item p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 500;
}

.reference-item:hover h4 {
    color: var(--secondary-color);
}

.reference-item:hover p {
    color: var(--text-color);
}

/* ===============================================
   DARK THEME OVERRIDES FOR NEW SECTIONS
   =============================================== */

[data-theme="dark"] .results-summary {
    background: rgb(15, 20, 31);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .results-summary h3 {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .result-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .result-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .quick-reference {
    background: rgb(17, 24, 39);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .quick-reference h3 {
    color: white;
}

[data-theme="dark"] .reference-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .reference-item p {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .reference-item:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .reference-item:hover p {
    color: white;
}

/* ===============================================
   RESPONSIVE UPDATES FOR NEW SECTIONS
   =============================================== */

@media (max-width: 768px) {
    .quick-reference {
        padding: 1.5rem;
    }
    
    .reference-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .reference-item {
        padding: 1rem;
    }
    
    .results-summary {
        padding: 1.5rem;
    }
    
    .result-item {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .result-value-item {
        font-size: 1.125rem;
        text-align: left;
    }
}

@media (max-width: 480px) {
    
    .hero-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .hero-icon i {
        font-size: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 12px;
    }
    
    .hero-content p {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    .calculator-main {
        padding: 60px 0 80px;
    }
    
    .result-value {
        font-size: 2.5rem;
    }
    
    .result-unit {
        font-size: 1.2rem;
    }
    
    .course-input-form,
    .cumulative-input-form,
    .gpa-goal-calculator {
        padding: 1.5rem;
    }
    
    .courses-header,
    .courses-container {
        padding: 1rem;
    }
    
    .course-item {
        padding: 1rem;
    }
}

@media (max-width: 900px) {
    .calculator-container {
        max-width: 98vw;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
        margin: 0 1vw;
    }
    .cumulative-btn-group, .goal-btn-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .clear-btn, .calculate-btn, .goal-btn {
        margin-left: 0 !important;
        width: 100%;
    }
    .input-row {
        grid-template-columns: 1fr 1fr 1fr 1fr;
        gap: 0.7rem;
    }
    .cumulative-inputs, .goal-inputs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .calculator-main {
        padding: 30px 0 60px;
    }
    .calculator-container {
        padding: 0.5rem;
        border-radius: var(--radius-base);
    }
    .cumulative-btn-group, .goal-btn-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .clear-btn, .calculate-btn, .goal-btn {
        margin-left: 0 !important;
        width: 100%;
        font-size: 1rem;
        padding: 0.7rem 1rem;
    }
    .input-group label, .input-group input {
        font-size: 1rem;
    }
    .input-group {
        margin-bottom: 0.7rem;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .input-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .cumulative-inputs, .goal-inputs {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }
}

/* ===============================================
   ACCESSIBILITY ENHANCEMENTS
   =============================================== */

/* Focus styles for keyboard navigation */
.add-course-btn:focus,
.action-btn:focus,
.clear-all-btn:focus,
.clear-history-btn:focus,
.course-remove:focus {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

.tab-button:focus {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: -3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
    
    [data-theme="dark"] {
        --border-color: #FFFFFF;
        --text-secondary: #FFFFFF;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .calculator-display::before,
    .hero-icon,
    .hero-icon::before,
    .hero-icon::after,
    .hero-icon i,
    .tool-hero::before {
        animation: none;
    }
}

/* Print styles */
@media print {
    .calculator-main {
        background: white;
        color: black;
    }
    
    .calculator-container {
        box-shadow: none;
        border: 1px solid black;
    }
    
    .calculator-display {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .action-btn,
    .clear-all-btn,
    .clear-history-btn,
    .course-remove {
        display: none;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.65);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}
.modal-content {
    background: var(--bg-primary);
    color: var(--text-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem 2rem 2rem;
    max-width: 350px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: modalPop 0.25s cubic-bezier(.4,2,.6,1) both;
}
.modal-icon {
    font-size: 2.5rem;
    color: var(--warning-color);
    margin-bottom: 1rem;
}
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}
.modal-btn {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-base);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.modal-btn.cancel {
    background: var(--gray-200);
    color: var(--text-secondary);
}
.modal-btn.confirm {
    background: var(--danger-color);
    color: #fff;
}
.modal-btn.cancel:hover {
    background: var(--gray-300);
}
.modal-btn.confirm:hover {
    background: #b91c1c;
}
@keyframes modalPop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.clear-btn {
    background: var(--gray-200);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    margin-left: 1rem;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-base);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.clear-btn:hover {
    background: var(--danger-color);
    color: #fff;
    border-color: var(--danger-color);
}

.cumulative-btn-group, .goal-btn-group {
    justify-content: flex-end;
    width: 100%;
}
