/* ==========================================================================
   NEXTBOT DESIGN SYSTEM: "Cool Crisp"
   Master Stylesheet - Imports & Page-Level Overrides
   ========================================================================== */

/*
   This file is loaded by all pages and acts as the single entry point.
   Design tokens, components, and layout are split into dedicated files:
   - theme.css      : CSS custom properties & Bootstrap overrides
   - components.css : Reusable component styles
   - layout.css     : Sidebar, topbar, content area layout

   Page-specific styles remain in their own files (api_test.css, map.css, etc.)
*/


/* --------------------------------------------------------------------------
   Global Resets & Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Ensure links use the design system */
a {
    color: var(--color-twitch-ice);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-twitch-purple);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-primary);
    font-weight: 600;
    line-height: 1.3;
}

/* Selection highlight */
::selection {
    background-color: rgba(236, 64, 122, 0.2);
    color: #000;
}

/* Focus outline for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-twitch-purple);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}


/* --------------------------------------------------------------------------
   Alert Enhancements
   -------------------------------------------------------------------------- */

.alert {
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    border-width: 1px;
}

.alert .btn-close {
    opacity: 0.5;
}

.alert .btn-close:hover {
    opacity: 0.8;
}


/* --------------------------------------------------------------------------
   Login Page
   -------------------------------------------------------------------------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-primary);
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(236, 64, 122, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 0, 0, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(236, 64, 122, 0.02) 0%, transparent 70%);
    animation: login-bg-shift 20s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes login-bg-shift {
    0% {
        background-position: 0% 0%;
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% {
        background-position: 100% 100%;
        opacity: 0.8;
    }
}

.login-card {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 100%;
    margin: var(--space-4);
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-8) var(--space-6);
}

.login-brand {
    text-align: center;
    margin-bottom: var(--space-6);
}

.login-brand .brand-icon-lg {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-twitch-purple), var(--color-twitch-purple-hover));
    border-radius: var(--radius-lg);
    color: #fff;
    font-size: 1.75rem;
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-glow-purple);
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.login-brand p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.login-form .form-control {
    padding: var(--space-3);
    font-size: 0.9375rem;
}

.login-form .btn-primary {
    padding: var(--space-3);
    font-size: 0.9375rem;
    font-weight: 600;
}

.login-error {
    margin-top: var(--space-4);
    padding: var(--space-3);
    background-color: var(--color-error-muted);
    border: 1px solid rgba(236, 64, 122, 0.20);
    border-radius: var(--radius-md);
    color: var(--color-error);
    font-size: 0.875rem;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: var(--space-6);
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

/* Password visibility toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--color-text-secondary);
}


/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .login-bg {
        animation: none;
    }

    .content-area .content-inner {
        animation: none;
    }
}
