/* ==========================================================================
   BASE STYLES - ProxWide Design System
   ========================================================================== */

/* ========================================
   RESET & BOX-SIZING
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================
   DOCUMENT
   ======================================== */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--trans-base), color var(--trans-base);
}

/* ========================================
   MEDIA DEFAULTS
   ======================================== */
img,
svg,
video {
    display: block;
    max-width: 100%;
}

/* ========================================
   INTERACTIVE ELEMENTS
   ======================================== */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========================================
   LAYOUT CONTAINERS
   ======================================== */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: var(--space-md);
    margin-top: 45px;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.main-content.impersonating {
    margin-top: 85px;
    /* 45px header + 40px banner */
}

/* Impersonation Banner */
.impersonation-banner {
    background-color: #f97316;
    color: white;
    text-align: center;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-weight: bold;
    position: fixed;
    top: 45px;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    height: 40px;
}

.impersonation-banner button {
    background: white;
    color: #f97316;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

.impersonation-banner button:hover {
    background: #fee2e2;
}

.main-content.planning-view {
    max-width: 100%;
    padding: 0;
}

/* Allow Dashboard/Game Center to override max-width */
.main-content.dashboard-full {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

/* --- GAME CENTER LEADERBOARD OVERRIDES --- */
.game-center-layout.leaderboard-active .dashboard-main {
    max-width: 100% !important;
    width: 100% !important;
    flex: 1 !important;
    padding: 0 0 0 1rem !important;
    /* Slight padding left */
    margin: 0 !important;
}

.game-center-layout.leaderboard-active .gc-section {
    max-width: 100% !important;
    margin: 0 !important;
    width: 100% !important;
}

.game-center-layout.leaderboard-active .gc-leaderboard-container {
    max-width: 100% !important;
    width: 100% !important;
}

@media (min-width: 768px) {
    .main-content {
        padding: var(--space-lg);
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   FORMS & INPUTS
   ======================================== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--text-main);
    font-weight: 500;
    font-size: var(--text-sm);
}

.form-input {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: inherit;
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: all var(--trans-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--bg-body);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: var(--text-xs);
}

.btn-w-full {
    width: 100%;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
/* Display */
.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-none {
    display: none;
}

.d-grid {
    display: grid;
}

/* Flex */
.flex-column {
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

/* Gap */
.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* Margin */
.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

/* Padding */
.p-2 {
    padding: 0.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.pl-6 {
    padding-left: 1.5rem;
}

.pr-6 {
    padding-right: 1.5rem;
}

/* Width */
.w-full {
    width: 100%;
}

/* Text */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

/* Colors */
.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-primary {
    color: var(--primary);
}

.text-gray-500 {
    color: #6b7280;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.bg-green-50 {
    background-color: #ecfdf5;
}

/* Border */
.rounded {
    border-radius: var(--radius-sm);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: var(--radius-full);
}

/* Other */
.cursor-pointer {
    cursor: pointer;
}

.pointer {
    cursor: pointer;
}

.hidden {
    display: none;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

.fade-in {
    animation: fadeIn 0.2s ease;
}

/* ========================================
   RETRO-FUTURISTIC HUD & EFFECTS (Theme Neon)
   ======================================== */
[data-theme="neon"] body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Grain + CRT Scanlines */
    background: 
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"),
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
    background-size: 200px 200px, 100% 4px, 4px 100%;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.15;
}

@keyframes cyber-glitch {
    0% { transform: translate(0); }
    5% { transform: translate(-2px, 1px); }
    10% { transform: translate(2px, -1px); }
    15% { transform: translate(0); }
    100% { transform: translate(0); }
}

@keyframes chromatic-aberration {
    0% { text-shadow: 2px 0 #ff0055, -2px 0 #00f3ff; }
    50% { text-shadow: -2px 0 #ff0055, 2px 0 #00f3ff; }
    100% { text-shadow: 2px 0 #ff0055, -2px 0 #00f3ff; }
}

.cyber-glitch-hover:hover {
    animation: cyber-glitch 0.3s steps(1) infinite;
    text-shadow: 2px 0 #ff0055, -2px 0 #00f3ff;
}

.logo-glitch,
[data-theme="neon"] .free-logo {
    animation: chromatic-aberration 2.5s infinite ease-in-out;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

/* ========== ADDITIONAL BASE STYLES ==========*/

.free-user-btn {
    padding: 6px;
    min-width: auto;
}



@media (min-width: 768px) {
    .main-content {
        margin-bottom: 0;
        padding: var(--space-lg);
    }
}

/* Components: Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: var(--z-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    box-shadow: var(--shadow-sm);
}

.brand {
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--primary);
    text-decoration: none;
}

/* Components: Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 640px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tool-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Components: Card */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.card:hover {

    box-shadow: var(--shadow-sm);
    border-color: rgba(212, 0, 0, 0.4);
}

.card h3 {
    margin-bottom: var(--space-sm);
    color: var(--text-main);
}

.card p {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* Components: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--trans-fast);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--bg-body);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-w-full {
    width: 100%;
}

/* Inputs */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--text-main);
    font-weight: 500;
    font-size: var(--text-sm);
}

.form-input {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.d-flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-1 {
    flex: 1;
}

.gap-2 {
    gap: 0.5rem;
}

.hidden {
    display: none;
}

.text-danger {
    color: var(--danger);
}

/* --- Component Styles Copied from JS files --- */

/* Header.js */
.free-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

[data-theme="dark"] .free-user-btn,
[data-theme="neon"] .free-user-btn {
    background: var(--bg-input);
}


.dropdown-item:hover {
    background-color: var(--bg-body);
}

.app-nav {
    display: none;
}

.nav-link {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: var(--text-sm);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-link.router-link-active {
    color: var(--primary);
    font-weight: 600;
}

@media (min-width: 768px) {
    .app-nav {
        position: sticky;
        top: 60px;
        height: 50px;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        justify-content: center;
        gap: var(--space-xl);
        z-index: 90;
    }

    .nav-link {
        flex: 0 0 auto;
        font-size: var(--text-base);
    }
}

/* ToolCard.js */
.tool-card {
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

