/* --- CSS Variables --- */
:root {
    --bg-base: #03050a;
    --panel-bg: rgba(13, 17, 31, 0.6);
    --panel-border: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    /* Maintained AAA contrast */
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #10b981;
    --danger: #ff2a5f;
    /* --font-sans: 'Plus Jakarta Sans', sans-serif; */
    /* 🟢 FONT CHANGED HERE */
    --font-sans: 'Outfit', sans-serif;
}

/* --- Global Reset & Strict Viewport Stack (FIXED FOR ONE-SCREEN) --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    /* ⚡ Sticky Footer Core Grid Engine */
    display: flex;
    flex-direction: column;
}

/* 🟢 RESPONSIVE FIX: Fluid container padding */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 1.5rem);
    width: 100%;
}

/* ⚡ Content expands cleanly, locking footer to bottom without page breaks */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centers layout vertically on full viewport heights */
    width: 100%;
}

.content-wrapper {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.hidden {
    display: none !important;
}

/* --- Ambient Glow Backgrounds --- */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: rgba(99, 102, 241, 0.15);
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: rgba(16, 185, 129, 0.1);
}

/* --- Glassmorphism Utilities --- */
.glass-nav,
.glass-panel,
.glass-footer,
.bento-card {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Navigation (FIXED) --- */
.glass-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--panel-border);
    padding: 0.75rem 0;
    flex-shrink: 0; /* Prevents structural compression */
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Nav Link Styling */
.nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s ease;
    position: relative;
    padding: 0.25rem 0;
}

.nav-link:hover {
    color: var(--text-main);
}

/* Active/Hover line under link */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s ease;
}

.logo-group:hover {
    transform: scale(1.02);
}

.logo-icon {
    position: relative;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
    flex-shrink: 0;
}

.ping-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-base);
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.logo-text {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.highlight-x {
    color: var(--danger);
    text-shadow: 0 0 15px rgba(255, 42, 95, 0.6);
}

/* --- 🟢 RESPONSIVE NAV MEDIA QUERIES --- */
@media (max-width: 600px) {
    .nav-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .nav-actions {
        gap: 1.2rem;
        width: 100%;
        justify-content: center;
    }

    .youtube-btn span {
        display: none;
    }

    .premium-btn {
        padding: 0.5rem 0.6rem;
    }
}

/* --- Buttons --- */
.premium-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.premium-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.primary-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    margin-top: 1rem;
}

.primary-btn:hover {
    background: #4f46e5;
    box-shadow: 0 5px 15px var(--primary-glow);
}

/* --- Hero Section --- */
/* 🟢 RESPONSIVE FIX: Fluid hero padding */
.hero-section {
    padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(1rem, 3vw, 1.5rem);
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

.hero-title {
    font-size: clamp(1.8rem, 6vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.text-gradient {
    background: linear-gradient(135deg, #10b981 0%, #6366f1 50%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: clamp(0.9rem, 3vw, 1rem);
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- Control Panel --- */
.control-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 16px;
    margin-bottom: 2.5rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 350px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    color: white;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-box input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* --- Bento Grid --- */
.bento-grid {
    /* 🟢 RESPONSIVE FIX: min(100%, 280px) prevents overflow on 320px screens */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    padding-bottom: 4rem;
}

.bento-card {
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 0;
}

.bento-card:hover::before {
    opacity: 1;
}

.bento-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
}

.disabled {
    cursor: not-allowed;
}

.card-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.disabled .card-content {
    filter: blur(2.5px);
    pointer-events: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tool-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    text-transform: uppercase;
    border: 1px solid;
}

.time-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.bento-card:hover .tool-title {
    color: var(--primary);
}

.tool-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--panel-border);
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.metric {
    font-size: 0.8rem;
    font-weight: 700;
}

.open-btn {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    color: var(--text-main);
}

.bento-card:not(.disabled):hover .open-btn {
    background: var(--primary);
    color: white;
}

.disabled .open-btn {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

/* --- Footer (LOCKING SYSTEM RUNTIME) --- */
.glass-footer {
    padding: 1.25rem 0;
    border-top: 1px solid var(--panel-border);
    background: rgba(5, 8, 16, 0.8);
    font-size: 0.85rem;
    flex-shrink: 0; /* Ensures container never squishes down */
    width: 100%;
}

.footer-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    text-align: center;
    gap: 0.25rem;
}

.divider {
    color: var(--panel-border);
    margin: 0 0.5rem;
}

.heartbeat {
    color: var(--danger);
    animation: heartbeat 1.5s ease-in-out infinite both;
}

/* --- Animations --- */
@keyframes ping {
    75%,
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes heartbeat {
    from {
        transform: scale(1);
        transform-origin: center center;
        animation-timing-function: ease-out;
    }

    10% {
        transform: scale(0.91);
        animation-timing-function: ease-in;
    }

    17 {
        transform: scale(0.98);
        animation-timing-function: ease-out;
    }

    33% {
        transform: scale(0.87);
        animation-timing-function: ease-in;
    }

    45% {
        transform: scale(1);
        animation-timing-function: ease-out;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- 🟢 RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
    .control-panel {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .tabs {
        justify-content: center;
    }

    .search-box {
        max-width: 100%;
        margin-top: 0.5rem;
    }

    /* Footer stacking nicely on tablets */
    .divider {
        display: none;
    }

    .footer-center p {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    /* Optimize header for very small screens */
    .glass-nav {
        padding: 0.75rem 0;
    }

    .premium-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }

    /* Tabs stacking logic on tiny screens */
    .tab-btn {
        flex: 1 1 calc(50% - 0.5rem);
        text-align: center;
        padding: 0.5rem;
    }

    /* Cards optimization */
    .bento-card {
        padding: 1.25rem;
    }

    .tool-title {
        font-size: 1.15rem;
    }
}

/* ==========================================================================
   Additions for Tools Pages & Accessibility
   ========================================================================== */

/* 1. Accessibility Utility - Crucial for 100% Lighthouse Accessibility score */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 2. Back Button Fix - Ensures <a> tags with .tab-btn class alignment */
a.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Fix: Glowing orange button background styling for Coming Soon badges */
.open-btn.orange-btn {
    background: rgba(249, 115, 22, 0.1) !important;
    border: 1px solid rgba(249, 115, 22, 0.3) !important;
    color: #f97316 !important;
}

/* Hover style correction for disabled cards */
.bento-card.disabled:hover .open-btn.orange-btn {
    background: #f97316 !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}