/* =========================================
   RexaAge - Retro Age Calculator Styles
   Based on Rexa Design System
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Retro Theme Variables as Default */
    --primary-color: #000;
    --accent-color: #ffbd2e;
    /* Orange from Rexa Retro */
    --bg-color: #e5e5e5;
    --card-bg: #fff;
    --text-main: #000;
    --text-muted: #444;
    --border-color: #000;

    /* Spacing & Borders */
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --border-width: 3px;
    --shadow-retro: 6px 6px 0px 0px #000;

    /* Fonts */
    --font-heading: 'Press Start 2P', cursive;
    --font-body: 'Press Start 2P', cursive;
    /* Using Pixel font for mostly everything as per "Retro" feel */
    --font-sans: 'Inter', sans-serif;
    /* For long text if needed */
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    background-image: radial-gradient(#000 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-main);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Layout Utilities */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* =========================================
   Header
   ========================================= */
.site-header {
    background: #fff;
    border-bottom: 4px solid #000;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
    object-fit: contain;
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    font-size: 0.7rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.nav-link:hover {
    background: var(--accent-color);
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #000;
}

.nav-link:active {
    transform: translate(3px, 3px);
    box-shadow: none;
}

.nav-link.active {
    background: var(--accent-color);
    font-weight: bold;
}

/* =========================================
   Main Content
   ========================================= */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 0;
}

.app-window {
    background: var(--card-bg);
    border: 4px solid #000;
    box-shadow: 12px 12px 0 #000;
    padding: 0;
    /* Header takes top space */
    width: 100%;
    max-width: 600px;
    /* Compact width for calculator form */
    position: relative;
    margin-bottom: 3rem;
}

.window-header {
    background: #000;
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #000;
}

.window-title {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.window-controls span {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #fff;
    margin-left: 4px;
}

/* Toggle for window controls purely visual */
.window-controls span:nth-child(1) {
    background: transparent;
}

.window-content {
    padding: 2rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.5rem;
}



label {
    display: block;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 1rem;
}

input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 1rem;
    border: 3px solid #000;
    font-family: var(--font-body);
    font-size: 1rem;
    background: #eee;
    box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.1);
    outline: none;
}

input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    background: #fff;
    box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0);
}

/* Button */
.btn {
    display: inline-block;
    width: 100%;
    padding: 1.25rem;
    background: #000;
    color: #fff;
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.1s, box-shadow 0.1s;
    margin-top: 1rem;
}

.btn:hover {
    background: var(--accent-color);
    color: #000;
    transform: translate(2px, 2px);
    box-shadow: 4px 4px 0 #000;
}

.btn:active {
    transform: translate(6px, 6px);
    box-shadow: none;
}

/* Result Area */
.result-display {
    margin-top: 2rem;
    display: none;
    /* Hidden by default */
}

.result-display.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Results Grid - 2 Column Layout */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Individual Result Windows */
.result-window {
    background: var(--card-bg);
    border: 3px solid #000;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-window:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.2);
}

/* Window Header for Result Cards */
.window-header-small {
    background: #000;
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    border-bottom: 3px solid #000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.window-header-small span {
    font-size: 1rem;
}

/* Window Body */
.window-body {
    padding: 1.5rem;
    flex: 1;
}

/* Window Text Styles */
.window-text {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.window-text:last-child {
    margin-bottom: 0;
}

.window-text-small {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.5rem;
}

.window-list {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    line-height: 1.6;
    list-style: disc;
    margin-left: 1.5rem;
    color: var(--text-main);
}

.window-list li {
    margin-bottom: 0.5rem;
}

/* Result Footer */
.result-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px dashed #ccc;
    font-size: 0.7rem;
    color: #666;
    text-align: center;
}

.stats-section {
    margin-bottom: 2rem;
    border-bottom: 2px dashed #ccc;
    padding-bottom: 2rem;
}

.stats-section:last-child {
    border-bottom: none;
}

.stats-section h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    display: block;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

/* Fix for large numbers in small grid slots */
.small-stats {
    grid-template-columns: 1fr;
    /* Stack them vertically to fit long numbers */
    margin-top: 1rem;
}

.small-stats .stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.small-stats .stat-value {
    font-size: 1rem;
    margin-bottom: 0;
    order: 2;
}

.small-stats .stat-label {
    font-size: 0.8rem;
    order: 1;
}

.stat-card {
    background: #fff;
    border: 2px solid #000;
    padding: 1rem;
    text-align: center;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

.stat-card.small {
    padding: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    color: #000;
    margin-bottom: 0.25rem;
    font-family: var(--font-heading);
}

.stat-value.smaller {
    font-size: 1rem;
    word-break: break-all;
}

.stat-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #666;
}

.list-stats {
    background: #fff;
    border: 2px solid #000;
    padding: 1rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 0.25rem;
}

.list-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.list-item span:last-child {
    font-weight: bold;
    color: #000;
}

.milestone-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.milestone-item {
    background: #222;
    color: #fff;
    padding: 0.75rem;
    font-size: 0.7rem;
    border-left: 4px solid var(--accent-color);
}

.timeline {
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid #000;
    margin-left: 0.5rem;
}

.timeline-item {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -0.6rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border: 2px solid #000;
}

.timeline-year {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.timeline-age {
    font-size: 0.7rem;
    color: #555;
    font-family: var(--font-sans);
}

.progress-bar {
    width: 100%;
    height: 1.5rem;
    background: #ccc;
    border: 2px solid #000;
    margin-top: 0.5rem;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-right: 2px solid #000;
    transition: width 0.5s ease-out;
}

.progress-fill.life-used {
    background: linear-gradient(90deg, #4ade80 0%, var(--accent-color) 50%, #ef4444 100%);
}

#older-than-text {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* =========================================
   About This Tool Section
   ========================================= */
.info-section {
    max-width: 1169px;
    background: #fff;
    padding: 2rem;
    margin: 0 auto 3rem;
    border: 4px solid #000;
    box-shadow: 12px 12px 0 #000;
}

.info-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    border-bottom: 3px solid #000;
    padding-bottom: 0.75rem;
    text-align: center;
    width: 100%;
    background: transparent;
}

.intro-text {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    margin: 1.5rem 0;
    text-align: center;
    color: var(--text-main);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-box {
    background: #fff;
    border: 3px solid #000;
    padding: 1.5rem;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-box:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.2);
}

.info-box h3 {
    font-size: 0.75rem;
    margin-bottom: 1rem;
    color: #000;
    border-bottom: 2px solid #ccc;
    padding-bottom: 0.5rem;
}

.info-box p {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.info-box ul {
    list-style: disc;
    margin-left: 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    line-height: 1.6;
}

.info-box ul li {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* =========================================
   Footer
   ========================================= */
.site-footer {
    background: #000;
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}

.footer-links {
    margin-bottom: 1.5rem;
}

.footer-links a {
    margin: 0 1rem;
    padding: 0.5rem;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 3px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .date-inputs {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 1rem;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    /* Stack results grid on mobile */
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .app-window {
        max-width: 100%;
    }

    .result-window {
        box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
    }

    .result-window:hover {
        transform: none;
        box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
    }

    /* Stack info grid on mobile */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Collapse Results Grids */
    .results-grid,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .info-box {
        box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
    }

    .info-box:hover {
        transform: none;
        box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
    }

    /* Mobile Nav */
    .header-nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }

    .header-inner {
        flex-direction: column;
    }

    .logo {
        font-size: 1rem;
        justify-content: center;
    }

    .container {
        padding: 0 1rem;
    }
}

/* =========================================
   RexaKit Retro Cursor Trail
   ========================================= */
.cursor-trail {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #000;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.8;
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    to {
        transform: scale(0);
        opacity: 0;
    }
}

/* Ad Space */
.ad-space {
    width: 100%;
    min-height: 100px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

/* Footer Social Icons */
.footer-social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.social-icon {
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none !important;
}

.social-icon:hover {
    opacity: 1;
    transform: translateY(-3px);
    color: var(--accent-color);
}

.social-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}