/* ==================== LENGTH CONVERTER - COMPLETE STYLES ==================== */
/* These styles match the exact HTML structure of your length converter */
/* Uses the same classes as your anniversary calculator for consistency */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ==================== CSS VARIABLES (Day/Night Support) ==================== */
:root {
    --bg: #0f0f17;
    --surface: #161622;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --border: #2d2d3d;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

/* Light Mode */
.light-mode {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --primary: #6366f1;
    --border: #e2e8f0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Dark Mode (automatic) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0f17;
        --surface: #161622;
        --text: #e2e8f0;
        --text-light: #94a3b8;
        --border: #2d2d3d;
    }
}

/* Light mode override when light class is present */
.light-mode {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
}

/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* ==================== MAIN CONTAINER ==================== */
.agecalc-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.agecalc-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

/* ==================== HEADER SECTION ==================== */
.agecalc-title {
    font-size: 3rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.agecalc-heart {
    font-size: 2.8rem;
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    75% { transform: scale(0.95); }
}

.agecalc-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-family: 'Poppins', sans-serif;
}

/* ==================== MAIN CARD ==================== */
.agecalc-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* ==================== INPUT GROUP (3 COLUMN LAYOUT) ==================== */
.agecalc-input-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

/* Input Cards */
.date-input-card {
    background: var(--bg);
    border-radius: 16px;
    padding: 1.2rem;
    border: 1px solid var(--border);
}

.date-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.9rem;
}

.required {
    color: var(--error);
}

.date-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.date-input[readonly] {
    background: var(--bg);
    cursor: default;
    opacity: 0.8;
}

/* Select Dropdown */
select.date-input {
    cursor: pointer;
    background: var(--surface);
}

select.date-input option {
    background: var(--surface);
    color: var(--text);
}

/* ==================== BUTTON STYLES ==================== */
.primary-action-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.primary-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Quick buttons specific */
.quick-btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
}

.quick-btn:active {
    transform: scale(0.95);
}

/* ==================== RESULTS SECTION ==================== */
.agecalc-results {
    background: var(--bg);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

/* Additional Info Grid */
.additional-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem;
    background: var(--surface);
    border-radius: 10px;
    align-items: center;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.info-value {
    font-weight: 600;
    color: var(--primary);
}

/* ==================== ACTION BUTTONS CONTAINER ==================== */
.agecalc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

/* ==================== QUICK CONVERSION BUTTONS ==================== */
.quick-buttons-container {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 968px) {
    .agecalc-input-group {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .date-input-card[style*="display: flex"] {
        display: flex !important;
        justify-content: center !important;
    }
}

@media (max-width: 768px) {
    .agecalc-container {
        padding: 0 1rem;
    }
    
    .agecalc-title {
        font-size: 2rem;
    }
    
    .agecalc-heart {
        font-size: 1.8rem;
    }
    
    .agecalc-card {
        padding: 1.2rem;
    }
    
    .date-input-card {
        padding: 1rem;
    }
    
    .additional-info {
        grid-template-columns: 1fr;
    }
    
    .agecalc-actions {
        justify-content: center;
    }
    
    .action-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
    
    .primary-action-btn {
        padding: 0.6rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .agecalc-title {
        font-size: 1.5rem;
    }
    
    .quick-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .info-row {
        flex-direction: column;
        text-align: center;
        gap: 0.3rem;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.agecalc-results {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.primary-action-btn:active {
    animation: pulse 0.2s ease;
}

/* ==================== LOADING STATE ==================== */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== ERROR STATE ==================== */
.date-input.error {
    border-color: var(--error);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message {
    color: var(--error);
    font-size: 0.75rem;
    margin-top: 0.3rem;
    display: block;
}

/* ==================== SUCCESS STATE ==================== */
.date-input.success {
    border-color: var(--success);
}

.success-message {
    color: var(--success);
    font-size: 0.75rem;
    margin-top: 0.3rem;
    display: block;
}

/* ==================== TOOLTIP ==================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background: var(--surface);
    color: var(--text);
    font-size: 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    display: none;
    z-index: 1000;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

[data-tooltip]:hover:before {
    display: block;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .agecalc-container {
        margin: 0;
        padding: 0;
    }
    
    .primary-action-btn,
    .action-btn,
    .quick-btn {
        display: none;
    }
    
    .agecalc-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .date-input {
        border: 1px solid #ddd;
        background: white;
        color: black;
    }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.date-input:focus-visible,
select.date-input:focus-visible,
.primary-action-btn:focus-visible,
.action-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==================== SCROLLBAR STYLING ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==================== SELECT OPTIONS STYLING ==================== */
select.date-input option {
    padding: 0.5rem;
}

/* Dark mode select options */
@media (prefers-color-scheme: dark) {
    select.date-input option {
        background: var(--surface);
        color: var(--text);
    }
}

/* ==================== DISABLED STATE ==================== */
.date-input:disabled,
.primary-action-btn:disabled,
.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== FOCUS WITHIN STYLES ==================== */
.date-input-card:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ==================== HIGH CONTRAST MODE ==================== */
@media (prefers-contrast: high) {
    .date-input,
    select.date-input {
        border-width: 2px;
    }
    
    .primary-action-btn,
    .action-btn {
        border: 1px solid currentColor;
    }
}