/* Root CSS Variables - Matching global.css */
:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-hover: #1d4ed8;
    --primary-shadow: rgb(37 99 235 / 25%);
    
    /* Legacy Primary (for backward compatibility) */
    --primary-color: var(--primary);
    --primary-color-light: var(--primary-light);
    
    /* Surface Colors */
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --surface-elevated: #ffffff;
    --background: #f8fafc;
    
    /* Legacy Surface (for backward compatibility) */
    --surface-color: var(--surface);
    --light-bg: var(--background);
    --secondary-bg: #e2e8f0;
    
    /* Border Colors */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    /* Legacy Border (for backward compatibility) */
    --border-color: var(--border);
    
    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Legacy Text (for backward compatibility) */
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    --secondary-color: #334155;
    
    /* Shadow System */
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
    --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 12px 24px rgb(15 23 42 / 0.12);
    --shadow-xl: 0 20px 25px rgb(15 23 42 / 0.1);
}

.calculator-intro {
    margin-bottom: 2.5rem;
}

.calculator-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.2;
}

.calculator-subtitle {
    font-size: 1.125rem;
    color: #4a5568;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    max-width: 760px;
}

.calculator-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.meta-chip {
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.calculator-main {
    margin-top: 2rem;
}

/* Results Container - Matching reference layout */
.results-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: clamp(1.25rem, 2vw, 1.75rem);
    border: 1px solid var(--border);
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
}

.results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

/* Empty State */
.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: 2rem;
}

.empty-state-icon {
    opacity: 0.5;
    margin-bottom: 1rem;
}

.calculator-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    animation: fadeInUp 0.6s ease-out;
    transition: transform 0.2s, box-shadow 0.2s;
}

.calculator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1), 0 15px 20px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-icon {
    width: 24px;
    height: 24px;
    color: #3b82f6;
}

.form-group-modern {
    margin-bottom: 1.5rem;
}

.form-label-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-trigger {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e5e7eb;
    border: none;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus {
    background: #3b82f6;
    color: #ffffff;
    outline: none;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    background: #1f2937;
    color: #ffffff;
    font-size: 0.875rem;
    border-radius: 8px;
    white-space: normal;
    width: 250px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    line-height: 1.5;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.tooltip-trigger:hover + .tooltip-content,
.tooltip-trigger:focus + .tooltip-content {
    opacity: 1;
}

.input-modern {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #f9fafb;
    min-height: 56px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .input-modern {
        padding: 1rem 1.25rem;
        font-size: 1.25rem;
        min-height: 52px;
    }
}

.input-modern:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.select-modern {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5rem;
    padding-right: 3rem;
    min-height: 56px;
}

.select-modern:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-direction: column;
}

@media (min-width: 768px) {
    .button-group {
        flex-direction: row;
    }
}

.btn-modern {
    flex: 1;
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 56px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .btn-modern {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
}

.btn-primary-modern {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.btn-primary-modern:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

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

.btn-secondary-modern {
    background: #ffffff;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary-modern:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.result-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    word-break: break-word;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.result-formula {
    font-size: 0.95rem;
    color: #475569;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    line-height: 1.6;
}

.gpa-conversion {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid #e2e8f0;
}

.gpa-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.gpa-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.gpa-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
}

.gpa-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (min-width: 480px) {
    .result-actions {
        grid-template-columns: 1fr 1fr;
    }
}

.copy-button {
    width: 100%;
    background: #dde3e7;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #405063;
    border: 1px solid #dde3e7;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.copy-button:hover {
    background: #cbd5e1;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.copy-button.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.export-button {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.export-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.share-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.share-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.75rem;
    text-align: center;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    justify-content: center;
}

@media (min-width: 640px) {
    .share-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    color: #ffffff;
    border: none;
    cursor: pointer;
    min-height: 44px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.share-x {
    background: #000000;
}

.share-x:hover {
    background: #1a1a1a;
}

.share-facebook {
    background: #1877f2;
}

.share-facebook:hover {
    background: #166fe5;
}

.share-linkedin {
    background: #0a66c2;
}

.share-linkedin:hover {
    background: #095195;
}

.share-reddit {
    background: #ff4500;
}

.share-reddit:hover {
    background: #e63e00;
}

.share-telegram {
    background: #0088cc;
}

.share-telegram:hover {
    background: #0077b3;
}

.share-whatsapp {
    background: #25d366;
}

.share-whatsapp:hover {
    background: #20ba5a;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile Responsive */
@media (max-width: 767px) {
    .calculator-title {
        font-size: 1.875rem;
    }
    
    .calculator-subtitle {
        font-size: 1rem;
    }
    
    .result-value {
        font-size: 1.75rem;
    }
    
    .calculator-card {
        padding: 1.5rem;
    }
    
    .input-modern {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }
    
    .btn-modern {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .calculator-title {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
*:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .calculator-card {
        border: 2px solid #000000;
    }
    
    .input-modern {
        border: 2px solid #000000;
    }
    
    .btn-modern {
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Educational Content Styles */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.angle-seo-section {
    padding: 2rem 0;
}

.angle-education-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    line-height: 1.8;
    color: #4a5568;
}

.angle-education-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1.5rem;
}

.angle-education-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 2rem 0 1rem;
}

.angle-education-card p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.angle-education-card a {
    color: #3b82f6;
    text-decoration: underline;
}

.angle-education-card a:hover {
    color: #2563eb;
}

/* Infographic Styles */
.infographic-timeline {
    margin: 2rem 0;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.infographic-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    text-align: center;
    margin-bottom: 2rem;
}

.timeline-container {
    overflow-x: auto;
    padding: 1rem 0;
}

.timeline-items {
    display: flex;
    gap: 1.5rem;
    min-width: max-content;
    padding: 1rem 0;
}

.timeline-item {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.timeline-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: #3b82f6;
}

.timeline-era {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.timeline-years {
    font-size: 0.875rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.75rem;
}

.timeline-description {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.infographic-conversion-formula {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

@media (min-width: 640px) {
    .infographic-conversion-formula {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .infographic-conversion-formula {
        grid-template-columns: repeat(3, 1fr);
    }
}

.formula-box {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.formula-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.formula-content {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.75rem;
}

.formula-example {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

/* Grade Conversion Infographic */
.grade-conversion-infographic {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 6px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.grade-conversion-infographic:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1), 0 12px 16px rgba(0, 0, 0, 0.15);
}

.infographic-header {
    text-align: center;
    margin-bottom: 2rem;
}

.infographic-header h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.infographic-header p {
    color: var(--text-muted);
    font-size: 0.95rem;margin-bottom: 0.5rem;
}

.conversion-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.conversion-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0;
}

.header-row {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-row > div {
    padding: 0.5rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.header-row > div:last-child {
    border-right: none;
}

.grade-row {
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.grade-row:last-child {
    border-bottom: none;
}

.grade-row:hover {
    background: var(--surface-muted);
    transform: translateX(4px);
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.05);
}

.grade-row > div {
    padding: 0.5rem;
    text-align: center;
    border-right: 1px solid var(--border);
    font-weight: 600;
    transition: color 0.2s ease;
}

.grade-row > div:last-child {
    border-right: none;
}

.col-percentage {
    color: var(--text-main);
}

.col-letter {
    color: var(--text-main);
    font-size: 1.1rem;
}

.col-gpa4 {
    color: #7c3aed;
}

.col-gpa5 {
    color: #dc2626;
}

.grade-row.excellent {
    background: rgba(16, 185, 129, 0.05);
}

.grade-row.good {
    background: rgba(59, 130, 246, 0.05);
}

.grade-row.average {
    background: rgba(245, 158, 11, 0.05);
}

.grade-row.below {
    background: rgba(251, 191, 36, 0.05);
}

.grade-row.fail {
    background: rgba(239, 68, 68, 0.05);
}

.infographic-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-color.excellent {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid rgba(16, 185, 129, 0.5);
}

.legend-color.good {
    background: rgba(59, 130, 246, 0.2);
    border: 2px solid rgba(59, 130, 246, 0.5);
}

.legend-color.average {
    background: rgba(245, 158, 11, 0.2);
    border: 2px solid rgba(245, 158, 11, 0.5);
}

.legend-color.below {
    background: rgba(251, 191, 36, 0.2);
    border: 2px solid rgba(251, 191, 36, 0.5);
}

.legend-color.fail {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.5);
}

@media (max-width: 768px) {
    .conversion-row {
        grid-template-columns: 1fr;
    }
    
    .header-row > div,
    .grade-row > div {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .header-row > div:last-child,
    .grade-row > div:last-child {
        border-bottom: none;
    }
    
    .infographic-legend {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Input Hints */
.input-hint {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

/* File Input */
.file-input-modern {
    padding: 0.75rem;
}

/* Empty State */
.empty-state-icon svg {
    color: var(--text-muted);
}

.empty-state-text {
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
    font-size: 1rem;
}

/* Results Content */
#resultsContent {
    display: none;
}

/* Result Formula */
.result-formula {
    margin-top: 1rem;
}

/* Result Actions Secondary */
.result-actions-secondary {
    margin-top: 0.5rem;
}

/* Grade History Section */
#gradeHistorySection {
    margin-top: 2rem;
    display: none;
}

.grade-history-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grade-history-wrapper {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#gradeHistoryTable {
    width: 100%;
    border-collapse: collapse;
}

#gradeHistoryTable thead {
    background: #f8fafc;
}

#gradeHistoryTable th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

#gradeHistoryTable th[style*="center"] {
    text-align: center;
}

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

.clear-history-btn {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Content Grid */
.content-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.content-card-box {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.content-card-box p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #2d3748;
}

/* Input hint styles */
.input-hint {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}



.export-button {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.export-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.grade-inputs {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.grade-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.remove-grade-btn {
    padding: 0.75rem;
    background: #fee2e2;
    border: 2px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.remove-grade-btn:hover {
    background: #fecaca;
    border-color: #f87171;
}

.add-grade-btn {
    width: 100%;
    padding: 1rem;
    background: #f0f9ff;
    border: 2px dashed #0ea5e9;
    border-radius: 8px;
    color: #0ea5e9;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.add-grade-btn:hover {
    background: #e0f2fe;
    border-color: #0284c7;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .calculator-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .calculator-header h1 {
        font-size: 1.875rem;
    }
    
    .calculator-header p {
        font-size: 1rem;
    }
    
    .grade-input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .calculator-card {
        padding: 1.5rem;
    }
    
    .input-modern {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }
    
    .btn-modern {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .calculator-header h1 {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .result-value {
        font-size: 1.25rem;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
*:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .calculator-card {
        border: 2px solid #000000;
    }
    
    .input-modern {
        border: 2px solid #000000;
    }
    
    .btn-modern {
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Educational Content Styles */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.content-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1), 0 15px 20px rgba(0, 0, 0, 0.15);
}