: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: #0ea5e9;
    
    /* 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);
    --secondary-color: var(--text-muted);
    --success-color: var(--success);
    --info-color: var(--info);
    --warning-color: var(--warning);
    --danger-color: var(--danger);
    --dark-text: var(--text-main);
    --border-radius: var(--radius-lg);
    --shadow: var(--shadow-md);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-converter-page {
    padding-bottom: 2rem;
    color: var(--text-main);
}

.converter-intro {
    margin-bottom: 2rem;
}

.converter-title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.converter-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    margin-bottom: 1rem;
    color: var(--text-muted);
    max-width: 700px;
    line-height: 1.6;
}

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

.meta-chip {
    background: var(--background);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-main);
    transition: var(--transition);
}

.meta-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.converter-main {
    margin-bottom: 2rem;
}

.converter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.converter-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.converter-form-section {
    display: flex;
    flex-direction: column;
}

.converter-result-section {
    display: flex;
    flex-direction: column;
}

.converter-form {
    max-width: 100%;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.status-bar svg {
    flex-shrink: 0;
    color: var(--info);
}

.status-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: var(--primary-light);
}

.input-group {
    margin-bottom: 1.5rem;
}

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

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

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

.tooltip-trigger {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--info);
    color: white;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
    line-height: 1;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus {
    background: var(--primary-hover);
    transform: scale(1.1);
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: var(--text-main);
    color: white;
    text-align: left;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: var(--shadow-xl);
}

.tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-main) transparent transparent transparent;
}

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

.calculator-input,
.calculator-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text-main);
    transition: var(--transition);
}

.calculator-input--large {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1rem 1.25rem;
}

.calculator-input:focus,
.calculator-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

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

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

.conversion-units-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.swap-button-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0.5rem;
}

.swap-button {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.swap-button:hover {
    background: var(--primary-hover);
    transform: rotate(180deg) scale(1.05);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.swap-button:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.swap-button svg {
    width: 20px;
    height: 20px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.calculate-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

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

.calculate-btn:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.ghost-btn {
    padding: 0.875rem 1.5rem;
    background: var(--background);
    color: var(--text-main);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ghost-btn:hover {
    background: var(--surface-muted);
    border-color: var(--border-dark);
}

.ghost-btn:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.results-container {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

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

.result-badge {
    background: linear-gradient(135deg, #ecfdf3 0%, #d1fae5 100%);
    color: #166534;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 700;
    border: 1px solid #86efac;
}

.result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-main {
    text-align: center;
    padding: 1.5rem 0;
}

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

.result-value {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.result-equation {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    flex: 1;
}

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

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

.result-actions {
    margin-top: auto;
}

.copy-buttons-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.copy-button {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--background);
    color: var(--text-main);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.copy-button:hover {
    background: var(--surface-muted);
    border-color: var(--primary);
    color: var(--primary);
}

.copy-button:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.copy-button svg {
    width: 16px;
    height: 16px;
}

.share-container {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.share-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.share-btn {
    padding: 0.625rem 0.75rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.share-x {
    background: #111827;
}

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

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

.share-reddit {
    background: #ff4500;
}

.share-telegram {
    background: #229ed9;
}

.share-whatsapp {
    background: #128c7e;
}

.presets-section {
    margin-top: 2rem;
}

.card-header {
    margin-bottom: 1.5rem;
}

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

.card-subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.preset-button {
    padding: 1rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preset-button:hover {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.preset-button:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.preset-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.preset-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Educational Content Styles */
.education-seo-section {
    padding: 3rem 0;
    background: var(--background);
}

.education-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
}

.education-card h2 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.3;
}

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

.education-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.education-card a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

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

.infographic-time-units,
.infographic-conversion-formula {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

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

.formula-boxes-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    flex-wrap: wrap;
}

.formula-box {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    flex: 1 1 calc(25% - 0.75rem);
    min-width: 200px;
}

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

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

.formula-example {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.tc-review {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    background: var(--background);
    margin-top: 2rem;
}

.tc-review__title {
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-main);
}

.tc-review__meta {
    margin:0;
    color: var(--text-muted);
    font-size: 1rem;
}

.tc-review__copy {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

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

/* Mobile Responsive */
@media (max-width: 992px) {
    .converter-card {
        padding: 1.5rem;
    }
    
    .converter-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .results-container {
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    .time-converter-page {
        padding: 0 0.75rem 2rem;
    }
    
    .converter-intro {
        margin-bottom: 1.5rem;
    }
    
    .converter-card {
        padding: 1.25rem;
    }
    
    .conversion-units-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .swap-button-wrapper {
        padding-bottom: 0;
        justify-content: center;
    }
    
    .swap-button {
        transform: rotate(90deg);
    }
    
    .swap-button:hover {
        transform: rotate(270deg) scale(1.05);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .calculate-btn,
    .ghost-btn {
        width: 100%;
    }
    
    .results-container {
        padding: 1.5rem;
        min-height: 250px;
    }
    
    .share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .presets-grid {
        grid-template-columns: 1fr;
    }
    
    .education-card {
        padding: 1.5rem;
    }
    
    .infographic-time-units,
    .infographic-conversion-formula {
        padding: 1.5rem;
    }
    
    .formula-boxes-row {
        flex-direction: column;
    }
    
    .formula-box {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .calculator-input--large {
        font-size: 1.125rem;
        padding: 0.875rem 1rem;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .copy-buttons-row {
        flex-direction: column;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
    }
    
    .tooltiptext {
        width: 180px;
        margin-left: -90px;
        font-size: 0.75rem;
    }
}

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

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .converter-main,
    .presets-section,
    .share-container,
    .form-actions {
        display: none;
    }
    
    .results-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}
