/*
------------------------------------------------------------------
GLOBAL STYLESHEET
This file is linked to all HTML pages to ensure a unified and consistent design.
------------------------------------------------------------------
*/

/* ==========================================================================
   DESIGN TOKENS
   Colors, timings, spacing, radius
   ========================================================================== */
:root {
    --background-color: rgb(12, 12, 12);
    --primary-neon: rgb(242, 189, 21);
    --primary-neon-rgb: 242, 189, 21;
    --text-color: rgb(242, 242, 242);
    --secondary-bg: rgb(21, 21, 21);
    --subtext-color: rgba(242, 242, 242, 0.84);
    --disabled-color: #666;
    
    /* New Semantic Colors */
    --surface-elevated: rgb(24, 24, 24);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --muted-text: rgba(242, 242, 242, 0.55);
    --overlay-bg: rgba(0, 0, 0, 0.6);

    --error-red: #d24242;
    --success-green: #39FF14;
    --platform-discord: #738ADB;
    --platform-kick: #00FF00;
    --platform-twitch: #9146FF;
    --platform-youtube: #FF0000;

    /* Harmonized Timings */
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --anim-speed: 0.3s;

    /* Layout Dimensions */
    --page-padding: 0.5rem;
    --page-shell-card-max-width: 630px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --footer-height: 0px;
    --page-shell-max-height: calc(100svh - var(--footer-height) - var(--safe-bottom) - (var(--page-padding) * 2));

    --radius-brand: 21px;
}

/* ==========================================================================
   GLOBAL ANIMATIONS
   Shared keyframes and animation helpers
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes neon-text-pulse {
    from { text-shadow: 0 0 3px var(--primary-neon), 0 0 7px var(--primary-neon), 0 0 21px var(--primary-neon); }
    to { text-shadow: 0 0 1px var(--primary-neon), 0 0 2px var(--primary-neon), 0 0 7px var(--primary-neon); }
}

@keyframes neon-border-pulse {
    0%, 100% { box-shadow: 0 0 7px var(--primary-neon); border-color: rgba(242, 189, 21, 0.3); }
    50% { box-shadow: 0 0 21px var(--primary-neon); border-color: var(--primary-neon); }
}

@keyframes pulse-horizontal {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(6px); opacity: 1; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-neon); }
}

/* ==========================================================================
   GLOBAL PRIMITIVES
   Reset-like behavior, typography, shared tokens, accessibility helpers
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.dm-sans {
    font-family: 'DM Sans', sans-serif;
}

.roboto {
    font-family: 'Roboto', sans-serif;
}

/* ==========================================================================
   REUSABLE UTILITIES
   Small cross-page helpers, state classes, visual utilities
   ========================================================================== */
.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-pulse-horizontal {
    animation: pulse-horizontal 1.5s ease-in-out infinite;
}

.u-hidden {
    display: none !important;
}

.neon-text {
    color: var(--primary-neon);
    text-shadow: 0 0 3px var(--primary-neon),
                 0 0 7px var(--primary-neon),
                 0 0 21px var(--primary-neon);
    animation: neon-text-pulse 2.1s infinite alternate;
}

.u-primary-neon {
    color: var(--primary-neon) !important;
}

.platform-twitch {
    color: var(--platform-twitch) !important;
}

.platform-youtube {
    color: var(--platform-youtube) !important;
}

.platform-kick {
    color: var(--platform-kick) !important;
}

.is-live {
    background-color: var(--success-green);
    box-shadow: 0 0 8px var(--success-green);
}

.is-offline {
    background-color: var(--error-red);
}

.custom-list {
    list-style: none;
    padding-left: 1rem;
}

.custom-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.custom-list li::before {
    content: "\25a0";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-neon);
    text-shadow: 0 0 3px var(--primary-neon), 0 0 5px var(--primary-neon);
}

/* ==========================================================================
   SHARED INTERACTIVE ELEMENTS
   Buttons, links, tooltips
   ========================================================================== */
.social-link {
    color: var(--subtext-color);
    transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;
}

.social-link:hover {
    color: var(--primary-neon);
    transform: scale(1.1);
    text-shadow: 0 0 5px var(--primary-neon);
}

/* ------------------------------------------------------------------
   TOOLTIP SYSTEM (MODAL STYLE)
   ------------------------------------------------------------------ */
.info-tooltip-container {
    display: inline-flex;
    align-items: center;
    cursor: help;
    z-index: 101;
}

.tooltip-icon {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    text-transform: lowercase;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.info-tooltip-container:hover .tooltip-icon {
    opacity: 1;
    color: var(--primary-neon);
}

.info-tooltip-text {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;

    width: 280px;
    max-width: 85vw;
    padding: 24px;
    background-color: rgba(0, 0, 0, 0.98);
    color: #fff;
    text-align: center;
    border-radius: var(--radius-brand);
    border: 2px solid var(--primary-neon);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.9);

    font-size: clamp(12px, 2.5vw, 16px);
    line-height: 1.6;
    font-weight: normal;
    text-transform: none;

    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.info-tooltip-container:hover .info-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ------------------------------------------------------------------
   PRIMARY BUTTON STYLE
   ------------------------------------------------------------------ */
.primary-submit-btn {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--primary-neon);
    color: var(--background-color);
    font-family: 'DM Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
    box-shadow: 0 0 5px rgba(242, 210, 0, 0.1);
    border: 1px solid var(--primary-neon);
    border-radius: var(--radius-brand);
    cursor: pointer;
    padding: 10px 24px;
    min-height: 40px;
    font-weight: 700;
    text-decoration: none;
}

.primary-submit-btn:hover:not(:disabled) {
    box-shadow: 0 0 15px var(--primary-neon);
    transform: translateY(-2px);
}

.primary-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #555;
    border-color: #555;
}

.secondary-submit-btn {
    -webkit-appearance: none;
    appearance: none;
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-brand);
    cursor: pointer;
    padding: 10px 24px;
    min-height: 40px;
    font-weight: 700;
    text-decoration: none;
}

.secondary-submit-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.secondary-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   SHARED BRANDING
   Brand title/subtitle system
   ========================================================================== */
.brand-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.brand-title {
    font-size: 2.1rem;
    font-weight: 900;
    line-height: 0.8;
    transition: font-size 0.3s;
}

.brand-subtitle {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 1.21rem;
    color: white;
    letter-spacing: 0.25em;
    line-height: 0.8;
    transition: font-size 0.3s;
}

@media (max-width: 640px) {
    .brand-title {
        font-size: 1.8rem;
    }

    .brand-subtitle {
        font-size: 1rem;
    }
}

/* ==========================================================================
   SHARED HEADER SYSTEM
   Site header, stream status, identity reminder
   ========================================================================== */
.app-header-main {
    padding: 21px 21px;
    border-bottom: 1px solid rgba(242, 189, 21, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    width: 100%;
    margin-bottom: 21px;
}

.header-status-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
    gap: 12px;
}

.status-indicator-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mute-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
}

.mute-btn:hover {
    color: var(--primary-neon);
}

.mute-btn i {
    font-size: 10px;
}

.mute-icon-active {
    color: var(--primary-neon) !important;
}

.mute-icon-muted {
    color: #666 !important;
}

.stream-status-text {
    font-size: 10px;
    text-transform: uppercase;
    color: #9ca3af;
}

.stream-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-brand);
    display: inline-block;
    margin-left: 3px;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.identity-flex {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 3px;
}

.reminder-username {
    font-size: 14px;
    color: white;
    font-weight: bold;
    line-height: 1;
}

.reminder-platform-label {
    font-size: 12px;
    color: var(--subtext-color);
    letter-spacing: -0.025em;
    flex-shrink: 0;
}

#reminderPlatform {
    color: inherit;
    font-weight: bold;
}

.header-access-status {
    font-size: 10px;
    color: var(--subtext-color);
    opacity: 0.85;
}

/* ==========================================================================
   SHARED TYPEWRITER
   Verification / terminal-style feedback
   ========================================================================== */
.typewriter-container {
    min-width: 280px;
    display: inline-block;
    text-align: left;
    width: 100%;
    min-height: 1.5rem;
}

.typewriter-target {
    font-family: 'Roboto', Arial, monospace;
    display: inline-block;
    color: var(--primary-neon);
    font-size: 0.9rem;
    white-space: nowrap;
    border-right: 3px solid var(--primary-neon);
    animation: blink-caret 0.5s step-end infinite;
    min-width: 1ch;
    vertical-align: bottom;
}

/* ==========================================================================
   CHALLENGE DETAIL UI 
   ========================================================================== */
.challenge-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 1.2rem;
}

.challenge-detail-header { 
    margin-bottom: 1.2rem; 
    border-bottom: 1px solid var(--primary-neon); 
    padding-bottom: 7px;
    padding-left: 3px;
}

.challenge-detail-title { 
    font-size: 1.1rem; 
    letter-spacing: 1px;
}

.challenge-detail-meta {
    font-size: 10px;
    color: var(--subtext-color);
}

.challenge-detail-field label {
    display: block;
    font-size: 12px;
    color: var(--subtext-color);
    text-transform: uppercase;
}

.challenge-detail-field > span {
    font-size: 12px;
    color: var(--text-color);
    font-weight: bold;
}

.challenge-detail-field .status-badge-wrapper {
    justify-content: flex-start;
}

.challenge-detail-field .status-badge {
    color: inherit !important;
    font-weight: 800;
    width: fit-content !important;
    padding: 0 12px;
}

.challenge-failure-field {
    margin-bottom: 1rem;
}

.challenge-detail-field .failure-reason-val {
    color: var(--error-red) !important;
    font-size: 0.75rem;
}

.challenge-detail-text { 
    background: rgba(0,0,0,0.5); 
    padding: 20px; 
    border-radius: var(--radius-brand); 
    border-left: 3px solid var(--primary-neon); 
    margin-bottom: 1.5rem; 
    min-height: 120px; 
    line-height: 1.6; 
    font-size: 12px; 
    color: var(--text-color); 
    overflow: auto;
}

.challenge-detail-text ul {
    margin: 8px 0 0 18px;
    padding: 0;
}


/* ==========================================================================
   CHALLENGE SHARE SYSTEM
   Shared across submit success, explorer, and public challenge page
   ========================================================================== */
.share-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.42rem;
    width: 100%;
    margin-top: 0.25rem;
}

.share-label {
    font-size: 0.65rem;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-align: left;
    margin: 0;
    opacity: 0.9;
}

.share-row {
    display: flex;
    align-items: center;
    justify-content: stretch;
    gap: 0.25rem;
    width: 100%;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 40px;
    min-width: 0;
    overflow: hidden !important;
    border: 1px solid var(--subtext-color);
    background-color: var(--background-color);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.89s ease;
}

.challenge-share-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    border: 1px solid var(--border-strong);
    background-color: var(--surface-elevated);
    transition:
        border-radius 0.89s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.89s ease,
        background-color 0.89s ease,
        box-shadow 0.89s ease;
    box-sizing: border-box;
}

/* Hover / active animation */
.challenge-share-btn:hover,
.challenge-share-btn:has(.copy-badge) {
    border-radius: var(--radius-brand) !important;
    border-color: var(--primary-neon) !important;
    background-color: rgba(242, 189, 21, 0.05) !important;
    box-shadow: 0 0 100px rgba(242, 189, 21, 0.2);
}

.challenge-share-btn:hover i,
.challenge-share-btn:has(.copy-badge) i {
    color: #fff !important;
}

/* Feedback badge */
.copy-badge {
    position: absolute;
    inset: -1px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-green);
    color: black;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 5;
    pointer-events: none;
    border-radius: var(--radius-brand) !important;
    animation: badgeOverlay 2.1s ease-in-out forwards;
}

.challenge-share-btn.copied {
    filter: grayscale(0.6);
    opacity: 0.7;
    pointer-events: none;
}

@keyframes badgeOverlay {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

.challenge-share-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.challenge-share-context-btn {
    width: 100%;
    text-decoration: none;
}

.challenge-share-context-btn i {
    margin-right: 10px;
}


/* ==========================================================================
   STATUS BADGES
   Shared badge styles and per-status visual variants
   ========================================================================== */

.status-badge-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 !important; 
}

.status-badge { 
    height: 22px;
    width: 100% !important;
    display: grid !important;
    place-items: center; 
    border-radius: var(--radius-brand) !important; 
    text-transform: uppercase; 
    font-weight: 800; 
    font-size: 9px; 
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.03);
    line-height: normal !important; 
    margin: 0;
    padding: 0;
}

.status-active {
    color: #3b82f6;
    box-shadow: inset 3px 0 0 #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.status-archived {
    color: #94a3b8;
    box-shadow: inset 3px 0 0 #94a3b8;
    background: rgba(148, 163, 184, 0.1);
}

.status-auctioned {
    color: #f59e0b;
    box-shadow: inset 3px 0 0 #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.status-completed {
    color: #10b981;
    box-shadow: inset 3px 0 0 #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.status-failed {
    color: var(--error-red);
    box-shadow: inset 3px 0 0 var(--error-red);
    background: rgba(239, 68, 68, 0.1);
}

.status-in_progress {
    color: var(--primary-neon);
    box-shadow: inset 3px 0 0 var(--primary-neon);
    background: rgb(242, 189, 21, 0.1);
}

.status-removed {
    color: #64748b;
    box-shadow: inset 3px 0 0 #64748b;
    background: rgba(100, 116, 139, 0.1);
}

.status-under_review {
    color: #f97316;
    box-shadow: inset 3px 0 0 #f97316;
    background: rgba(249, 115, 22, 0.1);
}

[hidden] {
    display: none !important;
}

