:root {
    --bg-color: #e5e5e5;
    --window-bg: #ffffff;
    --text-color: #000000;
    --border-color: #000000;
    --accent-color: #000000;
    --shadow-color: #000000;
    --grid-dot-color: #a0a0a0;
}

* {
    box-sizing: border-box;
    image-rendering: pixelated;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Press Start 2P', cursive;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Dot Grid Background */
    background-image: radial-gradient(var(--grid-dot-color) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Header Style */
.site-header {
    background: #fff;
    border-bottom: 4px solid #000;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.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;
    color: #000;
    font-weight: bold;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border: 3px solid #000;
    box-shadow: 3px 3px 0 #000;
    object-fit: contain;
    image-rendering: pixelated;
}

.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;
    color: #000;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.nav-link:hover {
    background: #ffbd2e;
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #000;
}

.nav-link:active {
    transform: translate(3px, 3px);
    box-shadow: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.main-layout {
    margin: 80px auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
    z-index: 1;
}

/* Window Styles matching the reference */
.converter-window,
.info-window {
    background-color: var(--window-bg);
    border: 4px solid var(--border-color);
    box-shadow: 10px 10px 0px 0px var(--shadow-color);
    position: relative;
    max-width: 700px;
    width: 100%;
    margin: 20px auto;
}

.title-bar {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-bar-text {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.title-bar-controls {
    display: flex;
    gap: 5px;
}

.control-box {
    width: 12px;
    height: 12px;
    background-color: #fff;
    border: 1px solid #000;
}

.window-body {
    padding: 30px;
}

/* Form Elements */
.input-group,
.select-wrapper {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

input,
select {
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    padding: 12px;
    background-color: #f0f0f0;
    border: 3px solid var(--border-color);
    border-radius: 0;
    outline: none;
    width: 100%;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23000' d='M0 0h10L5 10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
    text-overflow: ellipsis;
}

.currency-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: start;
}

.arrow-icon {
    font-size: 18px;
    text-align: center;
    padding-top: 28px;
    font-weight: bold;
}

/* Button matching reference */
.action-area {
    margin-top: 30px;
}

.retro-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    background-color: #000;
    color: #fff;
    border: 3px solid #000;
    padding: 20px;
    width: 100%;
    cursor: pointer;
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    transition: all 0.1s;
    font-weight: bold;
}

.retro-btn:hover {
    background-color: #fbbf24;
    color: #000;
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px #000;
}

.retro-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000;
}

/* Result Box - Preserving animation but fitting theme */
.result-box {
    margin-top: 30px;
    background-color: #000;
    border: 4px solid #000;
    padding: 20px;
    color: #fff;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none !important;
}

.neon-text {
    font-size: 20px;
    color: #fff;
    margin: 15px 0;
    line-height: 1.5;
}

.small-text {
    font-size: 10px;
    color: #aaa;
    margin: 5px 0;
}

.error-msg {
    color: #ff5555;
}

/* About Section Specifics */
.info-window .title-bar {
    background-color: #fff;
    color: #000;
    border-bottom: 4px solid #000;
    text-align: center;
    justify-content: center;
}

.info-window .title-bar-text {
    font-size: 16px;
    font-weight: bold;
}

.about-list {
    list-style: none;
    padding: 0;
    text-align: center;
}

.about-list li {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 12px;
}

/* Swap Button */
.swap-btn {
    background: #fff;
    border: 3px solid #000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 3px 3px 0 #000;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 25px;
    font-family: sans-serif;
    transition: all 0.1s;
}

.swap-btn:hover {
    background: #fbbf24;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #000;
}

.swap-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #000;
}

/* Footer styles moved to end of file */

/* Animations - PRESERVED */
@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.loading-animation {
    animation: blink 0.5s infinite;
    color: #fff;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 600px) {
    .currency-group {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .swap-btn {
        margin: 10px auto;
        transform: rotate(90deg);
    }

    .header-inner {
        flex-direction: column;
        gap: 15px;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .window-body {
        padding: 15px;
    }

    .main-layout {
        margin: 20px auto;
        gap: 20px;
    }

    .retro-btn {
        padding: 15px;
    }

    .container {
        padding: 0 1rem;
    }

    .site-header {
        padding: 1rem 0;
    }

    .info-section {
        padding: 1rem;
    }

    input,
    select {
        font-size: 13px;
    }
}

/* --- Graph Section Styles --- */
.graph-window {
    margin: 30px auto;
    max-width: 700px;
    width: 100%;
    transition: opacity 0.3s ease;
}

.chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.time-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    background-color: #fff;
    border: 2px solid #000;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: 3px 3px 0 #000;
    transition: all 0.1s;
}

.time-btn:hover {
    background-color: #fbbf24;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #000;
}

.time-btn.active {
    background-color: #000;
    color: #fff;
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.2);
    transform: translate(2px, 2px);
}

.chart-container {
    position: relative;
    background-color: #e0e0e0;
    border: 2px solid #000;
    height: 200px;
    width: 100%;
}

.pixel-tooltip {
    position: absolute;
    background: #000;
    color: #fff;
    padding: 5px;
    font-size: 8px;
    line-height: 1.8;
    border: 1px solid #fff;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -150%);
}

/* Scanline effect */
.chart-container::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
}

/* Duplicate Swap Button styles removed */

/* Multi-Currency Table */
.table-container {
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
    margin-top: 10px;
    border: 2px solid #fff;
}

.table-container::-webkit-scrollbar {
    width: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: #000;
}

.table-container::-webkit-scrollbar-thumb {
    background: #fff;
    border: 2px solid #000;
}

.retro-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: #fff;
    text-align: left;
}

.retro-table th {
    background-color: #fbbf24;
    color: #000;
    padding: 10px;
    position: sticky;
    top: 0;
    border-bottom: 2px solid #000;
}

.retro-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #444;
}

.retro-table tr:hover {
    background-color: #333;
    color: #fbbf24;
}

/* =========================================
   About This Tool Section (Ported from RexaAge)
   ========================================= */
.info-section {
    max-width: 1169px;
    min-height: 1522px;
    width: 100%;
    margin: 40px auto;
    background: #fff;
    padding: 2rem;
    border: 4px solid #000;
    box-shadow: 12px 12px 0 #000;
    /* Solid black shadow */
    position: relative;
    z-index: 10;
}

.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;
    text-transform: uppercase;
}

.intro-text {
    font-family: sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    margin: 1.5rem 0;
    text-align: center;
    color: var(--text-color);
}

.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 #000;
    /* Solid black shadow */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-box:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 #000;
    /* Solid black shadow on hover */
}

.info-box h3 {
    font-size: 0.75rem;
    margin-bottom: 1rem;
    color: #000;
    border-bottom: 2px solid #ccc;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
}

.info-box p {
    font-family: sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    color: #444;
}

.info-box ul {
    list-style: disc;
    /* margin-left: 1.5rem; */
    font-family: sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-box ul li {
    /* margin-bottom: 0.5rem; */
    color: #444;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    /* Stack inputs */
    .currency-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .select-wrapper {
        margin-bottom: 0;
    }

    /* Adjust Swap Button */
    .swap-btn {
        margin: 5px auto;
        transform: rotate(90deg);
        /* Vertical arrow */
    }

    /* Result Box Layout */
    .result-box {
        min-height: auto;
    }

    /* Hide Controls that don't fit */
    .chart-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* =========================================
   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;
    }
}

/* 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;
    position: relative;
    /* Ensure tooltip is relative to icon */
}

.social-icon:hover {
    opacity: 1;
    transform: translateY(-3px);
    color: #fbbf24;
    /* Yellow for visibility on black footer */
    background: transparent !important;
    box-shadow: none !important;
}

.social-icon::after {
    content: attr(title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 6px 10px;
    font-size: 12px;
    font-family: sans-serif;
    white-space: nowrap;
    border: 1px solid #444;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    visibility: hidden;
}

.social-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

.social-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* --- FIXED FOOTER STYLES --- */
.site-footer {
    background: #000;
    color: #fff !important;
    padding: 3rem 0;
    text-align: center;
    margin-top: 4rem;
    width: 100%;
    border-top: 4px solid #000;
    position: relative;
    z-index: 100;
}

.footer-links {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-family: 'Press Start 2P', cursive;
    transition: color 0.2s;
    padding: 0.5rem;
}

.footer-links a:hover {
    color: #fbbf24;
    text-decoration: underline;
    text-decoration-thickness: 3px;
}

.site-footer p {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: #fff;
    text-align: center;
    margin-top: 25px;
    opacity: 0.9;
}