/**
 * KB Design System - Base Variables & Typography
 * ================================================
 * 
 * SINGLE SOURCE OF TRUTH for all Kabalah Universal pages.
 * This file MUST be loaded FIRST before any other custom CSS.
 * All pages (Dashboard, Player Courses, Live Player) inherit from here.
 * 
 * @package Kabalah Universal
 * @since 1.2.0
 */

/* ============================================
   CSS RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   DESIGN TOKENS (CSS Variables)
   ============================================ */
:root {
    /* =========================
       COLOR PALETTE - PRIMARY
       ========================= */
    --color-primary: #1e3a5f;
    --color-primary-light: #2d4a6f;
    --color-primary-dark: #0f2847;

    /* =========================
       COLOR PALETTE - ACCENT
       ========================= */
    --color-accent: #3b82f6;
    --color-accent-hover: #2563eb;
    --color-success: #16a34a;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;

    /* =========================
       BACKGROUNDS
       ========================= */
    --bg-sidebar: #ffffff;
    --bg-viewport: #f8fafc;
    --bg-card: #ffffff;
    --bg-section-hover: #f1f5f9;

    /* =========================
       TEXT COLORS
       ========================= */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* =========================
       BORDERS
       ========================= */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;

    /* =========================
       SHADOWS
       ========================= */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* =========================
       TRANSITIONS
       ========================= */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* =========================
       BORDER RADIUS
       ========================= */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

/* ============================================
   TYPOGRAPHY BASE
   ============================================ */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg-viewport);
}

/* ============================================
   TYPOGRAPHY HIERARCHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    margin: 0;
}

h1 {
    font-size: 2rem;
}

/* 32px */
h2 {
    font-size: 1.5rem;
}

/* 24px */
h3 {
    font-size: 1.25rem;
}

/* 20px */
h4 {
    font-size: 1.125rem;
}

/* 18px */
h5 {
    font-size: 1rem;
}

/* 16px */
h6 {
    font-size: 0.875rem;
}

/* 14px */

p {
    margin: 0;
    color: var(--text-secondary);
}

small {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   BUTTONS BASE
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
    background: var(--color-primary);
    color: var(--text-white);
    border-color: var(--color-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-section-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Accent Button */
.btn-accent {
    background: var(--color-accent);
    color: var(--text-white);
    border-color: var(--color-accent);
}

.btn-accent:hover:not(:disabled) {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

/* ============================================
   BADGES BASE
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-live {
    background: var(--color-danger);
    color: var(--text-white);
}

.badge-success {
    background: var(--color-success);
    color: var(--text-white);
}

.badge-primary {
    background: var(--color-primary);
    color: var(--text-white);
}

/* ============================================
   CARDS BASE
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================
   FORM INPUTS BASE
   ============================================ */
input,
textarea,
select {
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   DEMO BANNER RIBBON
   ============================================ */
.kb-demo-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 35px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 50%, #1e3a5f 100%);
    z-index: 9999;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-bottom: 2px solid #3b82f6;
}

.kb-demo-banner-content {
    display: flex;
    align-items: center;
    height: 100%;
    animation: kb-scroll-banner 30s linear infinite;
    white-space: nowrap;
}

.kb-demo-text {
    display: inline-block;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0 3rem;
    line-height: 35px;
}

@keyframes kb-scroll-banner {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-33.333%);
    }
}

/* Adjust body to account for banner */
body {
    padding-top: 35px;
}

/* Adjust header if it's fixed */
#kb-header.kb-header {
    top: 35px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .kb-demo-banner {
        height: 30px;
    }

    .kb-demo-text {
        font-size: 0.75rem;
        letter-spacing: 1px;
        padding: 0 2rem;
        line-height: 30px;
    }

    body {
        padding-top: 30px;
    }

    #kb-header.kb-header {
        top: 30px;
    }
}