:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-hover: #1d4ed8;
    --primary-shadow: rgb(37 99 235 / 25%);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --accent: #36cfc9;
    
    /* Surface Colors */
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --surface-elevated: #ffffff;
    --background: #f8fafc;
    --secondary-bg: #e2e8f0;
    
    /* Border Colors */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-inverse: #ffffff;
    
    /* 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);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Layout */
    --max-width-reading: 720px;
    --max-width-content: 1200px;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    
    /* Legacy Variables (for backward compatibility) */
    --primary-color: var(--primary);
    --primary-color-light: var(--primary-light);
    --surface-color: var(--surface);
    --light-bg: var(--background);
    --border-color: var(--border);
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    
    /* Angle Converter Variables (for educational content styling) */
    --angle-primary: #2563eb;
    --angle-primary-dark: #1d4ed8;
    --angle-accent: #0ea5e9;
    --angle-surface: #ffffff;
    --angle-border: #e2e8f0;
    --angle-text: #0f172a;
    --angle-muted: #64748b;
    --angle-success: #22c55e;
    --angle-radius-lg: 1.5rem;
    --angle-radius-md: 1rem;
    --angle-radius-sm: 0.75rem;
    --angle-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.08);
    --angle-shadow-lg: 0 30px 60px rgba(37, 99, 235, 0.12);
}

.subtract-time-page {
    padding-bottom: 2rem;
}

/* Calculator Intro */
.calculator-intro {
    padding: 1rem 0 2rem;
    margin: 0 auto;
}

.calculator-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.calculator-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    width: 720px;
    line-height: 1.6;
}

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

.meta-chip {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Calculator Main */
.calculator-main {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: 3rem;
}

.calculator-card {
    padding: 0rem 2rem;
    height: 100%;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
}

.status-info {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.status-bar svg {
    flex-shrink: 0;
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9375rem;
}

.label-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.optional-badge {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    background: var(--surface-muted);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-flex;
}

.tooltip-trigger {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    margin-left: 0.5rem;
}

.tooltip-trigger:hover {
    background: var(--primary-dark);
}

.tooltiptext {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: var(--text-inverse);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    max-width: 200px;
    white-space: normal;
    text-align: center;
}

.tooltip-trigger:hover + .tooltiptext,
.tooltip-trigger:focus + .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltiptext::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-main);
}

/* Calculator Inputs */
.calculator-input {
    width: 100%;
    padding: 1rem 1.15rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    background: var(--surface-color);
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
    
}

.calculator-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.calculator-input:invalid:not(:placeholder-shown) {
    border-color: var(--danger);
}

.calculator-input::placeholder {
    color: var(--text-light);
}

.invalid-feedback {
    display: none;
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.calculator-input:invalid:not(:placeholder-shown) ~ .invalid-feedback {
    display: block;
}

/* Section Divider */
.section-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.section-divider span {
    background: var(--surface);
    padding: 0 1rem;
    position: relative;
}

/* Time Inputs Grid */
.time-inputs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
    width: 100%;
}

.form-actions .calculate-btn,
.form-actions .ghost-btn {
    flex: 1 1 auto;
    min-width: 140px;
}

.calculate-btn {
    flex: 1 1 200px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px var(--primary-shadow);
}

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

.ghost-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 0.9rem;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.ghost-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Results Container */
.results-container {
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    background: var(--light-bg);
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-main {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--surface-muted) 100%);
    border-radius: var(--radius-md);
}

.result-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.4;
}

.result-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.breakdown-item {
    padding: 1rem;
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.breakdown-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.breakdown-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Empty State */
.empty-state-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
}

.empty-state-icon {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.empty-state-content p {
    font-size: 1rem;
    margin: 0;
}

/* Result Actions */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.copy-buttons-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.copy-buttons-row .copy-button {
    flex: 1 1 auto;
    min-width: 140px;
}

.copy-button {
    width: 49%;
    background: #f1f5f9;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #405063 !important;
    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: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

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

/* Share Container */
.share-container {
    background: rgba(241, 245, 249, 0.8);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
}

.share-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.2);
    color: #ffffff;
}

.share-x { background: #111827; }
.share-facebook { background: #1877f2; }
.share-linkedin { background: #0a66c2; }
.share-reddit { background: #ff4500; }
.share-telegram { background: #229ed9; }
.share-whatsapp { background: #25d366; color: #0f172a; }

/* Educational Content Section */
.angle-seo-section {
    padding: 2rem 0;
}

.angle-card {
    background: var(--angle-surface);
    border-radius: var(--angle-radius-lg);
    padding: clamp(2rem, 4vw, 3rem);
    box-shadow: var(--angle-shadow-sm);
    border: 1px solid var(--angle-border);
}

.angle-education-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.angle-education-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.angle-education-card p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.angle-education-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.angle-education-card a:hover {
    border-bottom-color: var(--primary);
}

/* Infographic Timeline */
.infographic-timeline {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--surface-muted);
    border-radius: var(--radius-lg);
}

.infographic-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 2rem;
}

.timeline-container {
    position: relative;
    padding: 1rem 0;
}

.timeline-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    position: relative;
}

.timeline-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.timeline-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-icon svg {
    width: 100%;
    height: 100%;
}

.timeline-era {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.timeline-years {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.timeline-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Infographic Formula Boxes */
.infographic-conversion-formula {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.formula-box {
    padding: 1.5rem;
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.formula-box:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.formula-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.formula-content {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.formula-example {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Screen Reader Only */
.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;
}

/* Responsive Design */
@media (max-width: 991px) {
    .calculator-main {
        padding: 1.5rem;
    }

    .calculator-card {
        padding: 1.5rem;
    }
    
    .calculator-title {
        font-size: 2rem;
    }
    
    .time-inputs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .share-buttons {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .calculator-intro {
        padding: 1.5rem 0 2rem;
    }
    
    .calculator-title {
        font-size: 1.75rem;
    }
    
    .calculator-subtitle {
        font-size: 1rem;
    }
    
    .calculator-card {
        padding: 1.5rem;
    }
    
    .results-container {
        padding: 1.5rem;
        min-height: 300px;
    }
    
    .time-inputs-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .calculate-btn,
    .ghost-btn {
        width: 100%;
    }
    
    .share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline-items {
        grid-template-columns: 1fr;
    }
    
    .infographic-conversion-formula {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .calculator-title {
        font-size: 1.5rem;
    }
    
    .calculator-card {
        padding: 1rem;
    }
    
    .results-container {
        padding: 1rem;
    }
    
    .result-value {
        font-size: 1.25rem;
    }
    
    .share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .calculator-input {
        border-width: 3px;
    }
    
    .calculate-btn,
    .ghost-btn {
        border-width: 2px;
    }
}

/* Print Styles */
@media print {
    .calculator-card,
    .results-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .form-actions,
    .result-actions,
    .share-container {
        display: none;
    }
}

