/* ============================================================
   TYPHON CYBER RANGE — Design System
   A unified CSS file for the entire application.
   All pages and components should reference these variables
   instead of hardcoding colors.
   ============================================================ */

/* -----------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   ----------------------------------------------------------- */
:root {
    /* Primary accent — interactive elements, buttons, links */
    --ty-primary: #3B82F6;
    --ty-primary-hover: #2563EB;
    --ty-primary-light: #60A5FA;
    --ty-primary-glow: rgba(59, 130, 246, 0.5);
    --ty-primary-subtle: rgba(59, 130, 246, 0.08);
    --ty-primary-border: rgba(59, 130, 246, 0.35);

    /* Surface hierarchy (darkest → lightest) */
    --ty-bg: #0B1326;
    --ty-surface-lowest: #060E20;
    --ty-surface-low: #0F172A;
    --ty-surface: #131B2E;
    --ty-surface-container: #171F33;
    --ty-surface-high: #1E293B;
    --ty-surface-highest: #2D3449;
    --ty-surface-bright: #334155;

    /* Text hierarchy (dimmest → brightest) */
    --ty-text-dim: #475569;
    --ty-text-muted: #64748B;
    --ty-text-secondary: #94A3B8;
    --ty-text-body: #CBD5E1;
    --ty-text-primary: #DAE2FD;
    --ty-text-bright: #FFFFFF;

    /* Borders */
    --ty-border: #334155;
    --ty-border-subtle: rgba(71, 85, 105, 0.3);
    --ty-border-accent: rgba(59, 130, 246, 0.35);

    /* Semantic colors */
    --ty-error: #F87171;
    --ty-error-bg: rgba(248, 113, 113, 0.08);
    --ty-error-border: rgba(248, 113, 113, 0.3);
    --ty-success: #22C55E;
    --ty-success-bg: rgba(34, 197, 94, 0.08);
    --ty-warning: #FBBF24;

    /* Secondary (for register, less prominent actions) */
    --ty-secondary: #818CF8;
    --ty-secondary-bg: rgba(99, 102, 241, 0.1);
    --ty-secondary-border: rgba(99, 102, 241, 0.4);

    /* Typography */
    --ty-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Border radius */
    --ty-radius-sm: 4px;
    --ty-radius-md: 6px;
    --ty-radius-lg: 12px;
    --ty-radius-xl: 16px;
    --ty-radius-full: 9999px;

    /* Shadows */
    --ty-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --ty-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --ty-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --ty-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --ty-transition-fast: 0.15s ease;
    --ty-transition: 0.2s ease;
}


/* -----------------------------------------------------------
   2. BASE RESET & DEFAULTS
   ----------------------------------------------------------- */
html, body {
    font-family: var(--ty-font);
    background-color: var(--ty-bg);
    color: var(--ty-text-body);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* -----------------------------------------------------------
   3. BUTTONS
   ----------------------------------------------------------- */

/* Base button */
.ty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--ty-radius-md);
    font-family: var(--ty-font);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--ty-transition);
    white-space: nowrap;
    text-decoration: none;
}

.ty-btn:active {
    transform: translateY(1px);
}

/* Primary button — filled blue */
.ty-btn-primary {
    background-color: var(--ty-primary);
    color: var(--ty-text-bright);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4), 0 2px 4px -1px rgba(59, 130, 246, 0.2);
}

.ty-btn-primary:hover {
    background-color: var(--ty-primary-hover);
    box-shadow: 0 6px 10px -1px rgba(59, 130, 246, 0.5);
}

/* Secondary button — outline/ghost */
.ty-btn-secondary {
    background-color: var(--ty-surface-high);
    color: var(--ty-text-body);
    border-color: var(--ty-border);
    box-shadow: var(--ty-shadow-sm);
}

.ty-btn-secondary:hover {
    background-color: var(--ty-surface-bright);
    border-color: var(--ty-text-secondary);
}

/* Ghost button — transparent, accent border */
.ty-btn-ghost {
    background-color: var(--ty-primary-subtle);
    border-color: var(--ty-primary-border);
    color: var(--ty-primary-light);
}

.ty-btn-ghost:hover {
    background-color: rgba(59, 130, 246, 0.18);
    border-color: var(--ty-primary-light);
    box-shadow: 0 0 10px var(--ty-primary-glow);
}

/* Danger button — for logout, destructive */
.ty-btn-danger {
    background-color: var(--ty-error-bg);
    border-color: var(--ty-error-border);
    color: var(--ty-error);
}

.ty-btn-danger:hover {
    background-color: rgba(248, 113, 113, 0.18);
    border-color: var(--ty-error);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.2);
}

/* White button — for landing page CTA */
.ty-btn-white {
    background-color: var(--ty-text-bright);
    color: var(--ty-surface-low);
    border: none;
    padding: 14px 32px;
    border-radius: var(--ty-radius-lg);
    font-size: 0.875rem;
    box-shadow: var(--ty-shadow-lg);
}

.ty-btn-white:hover {
    background-color: var(--ty-surface-highest);
    color: var(--ty-text-bright);
}

/* Small header button variant */
.ty-btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
    border-radius: 5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}


/* -----------------------------------------------------------
   4. CARDS
   ----------------------------------------------------------- */
.ty-card {
    background-color: var(--ty-surface-high);
    border: 1px solid var(--ty-border);
    border-radius: var(--ty-radius-xl);
    padding: 48px;
    box-shadow: var(--ty-shadow-xl);
    text-align: center;
    max-width: 460px;
    width: 100%;
}


/* -----------------------------------------------------------
   5. BADGES / PILLS
   ----------------------------------------------------------- */
.ty-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: var(--ty-radius-full);
    border: 1px solid rgba(140, 144, 159, 0.6);
    background: rgba(23, 31, 51, 0.5);
    backdrop-filter: blur(4px);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ty-text-secondary);
}


/* -----------------------------------------------------------
   6. DROPDOWNS
   ----------------------------------------------------------- */
.ty-dropdown {
    position: absolute;
    min-width: 160px;
    background-color: var(--ty-surface-lowest);
    border: 1px solid var(--ty-border-accent);
    border-radius: var(--ty-radius-md);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.05);
    animation: ty-dropdown-in var(--ty-transition-fast);
    z-index: 1100;
}

@keyframes ty-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ty-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--ty-border-subtle);
    color: var(--ty-text-secondary);
    padding: 9px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color var(--ty-transition-fast), color var(--ty-transition-fast);
    text-align: left;
}

.ty-dropdown-item:last-child {
    border-bottom: none;
}

.ty-dropdown-item:hover {
    background-color: var(--ty-primary-subtle);
    color: var(--ty-primary-light);
}

.ty-dropdown-item--disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ty-dropdown-item--disabled:hover {
    background-color: transparent !important;
    color: var(--ty-text-secondary) !important;
}


/* -----------------------------------------------------------
   7. STATUS INDICATORS
   ----------------------------------------------------------- */
.ty-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--ty-primary);
    box-shadow: 0 0 8px var(--ty-primary-glow);
    flex-shrink: 0;
}

.ty-dot--pulse {
    animation: ty-pulse 2.5s ease-in-out infinite;
}

@keyframes ty-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--ty-primary-glow); }
    50%       { opacity: 0.5; box-shadow: 0 0 4px rgba(59, 130, 246, 0.2); }
}


/* -----------------------------------------------------------
   8. FULLSCREEN OVERLAY (Landing, Login pages)
   ----------------------------------------------------------- */
.ty-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    font-family: var(--ty-font);
    z-index: 1000;
    overflow: hidden;
}

.ty-fullscreen-center {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* -----------------------------------------------------------
   9. HERO SECTION (Landing page)
   ----------------------------------------------------------- */
.ty-hero {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ty-hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ty-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.15);
}

.ty-hero__content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    max-width: 1280px;
    margin: 0 auto;
    gap: 24px;
}

.ty-hero__headline {
    font-size: 60px;
    line-height: 72px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ty-text-bright);
    margin: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.ty-hero__tagline {
    font-size: 1.125rem;
    line-height: 1.75rem;
    color: var(--ty-text-secondary);
    margin: 0;
}

@media (max-width: 768px) {
    .ty-hero__headline {
        font-size: 28px;
        line-height: 36px;
    }
    .ty-hero__content {
        padding: 16px;
    }
    .ty-br-desktop {
        display: none;
    }
}

@media (max-width: 360px) {
    .ty-hero__headline {
        font-size: 22px;
        line-height: 28px;
    }
}


/* -----------------------------------------------------------
   10. FOOTER (Landing page)
   ----------------------------------------------------------- */
.ty-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 24px;
    text-align: center;
    z-index: 20;
    opacity: 0.6;
}

.ty-footer span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ty-text-secondary);
}

.ty-footer a {
    color: var(--ty-primary-light);
    text-decoration: none;
    transition: color var(--ty-transition);
}

.ty-footer a:hover {
    color: var(--ty-primary);
    text-decoration: underline;
}


/* -----------------------------------------------------------
   11. ROLE CARDS (Home page)
   ----------------------------------------------------------- */
.ty-role-cards {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.ty-role-card {
    background-color: var(--ty-surface-container);
    border: 2px solid var(--ty-primary);
    border-radius: var(--ty-radius-lg);
    padding: 2.5rem 1.5rem;
    width: 260px;
    text-align: center;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    transition: transform var(--ty-transition), box-shadow var(--ty-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.ty-role-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
}

.ty-role-card--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.ty-role-card__icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.ty-role-card h4 {
    font-weight: bold;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    color: var(--ty-text-bright);
}

.ty-role-card p {
    font-size: 0.95rem;
    color: var(--ty-text-body);
    line-height: 1.5;
    margin: 0;
}


/* -----------------------------------------------------------
   12. FORM INPUTS
   ----------------------------------------------------------- */
.ty-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ty-text-secondary);
}

.ty-input {
    width: 100%;
    background-color: var(--ty-surface-highest);
    border: 1px solid var(--ty-border);
    border-radius: var(--ty-radius-sm);
    padding: 10px 16px;
    color: var(--ty-text-primary);
    font-family: var(--ty-font);
    font-size: 16px;
    line-height: 24px;
    transition: all var(--ty-transition);
    outline: none;
    box-sizing: border-box;
}

.ty-input::placeholder {
    color: rgba(140, 144, 159, 0.4);
}

.ty-input:focus {
    border-color: var(--ty-primary);
    box-shadow: 0 0 0 1px var(--ty-primary);
}

.ty-input--icon {
    padding-left: 40px;
}

.ty-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--ty-primary);
    cursor: pointer;
}


/* -----------------------------------------------------------
   13. DIVIDERS
   ----------------------------------------------------------- */
.ty-divider {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ty-divider__line {
    flex: 1;
    height: 1px;
    background-color: var(--ty-border);
}

.ty-divider__text {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--ty-text-secondary);
    white-space: nowrap;
}


/* -----------------------------------------------------------
   14. AMBIENT BACKGROUNDS
   ----------------------------------------------------------- */
.ty-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(140, 144, 159, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(140, 144, 159, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.ty-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}


/* -----------------------------------------------------------
   15. LINK STYLES
   ----------------------------------------------------------- */
.ty-link {
    color: var(--ty-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--ty-transition);
}

.ty-link:hover {
    color: var(--ty-primary-light);
    text-decoration: underline;
    text-underline-offset: 4px;
}
