/* ========================================
   NOVA LIGA BR - DESIGN SYSTEM v2.0
   Racing-Inspired Modern UI
   ======================================== */

/* === ROOT VARIABLES === */
:root {
    /* Racing Colors */
    --racing-black: #0a0a0f;
    --racing-dark: #15151a;
    --racing-dark-2: #1f1f24;
    --racing-accent: #ffea00;
    --racing-accent-2: #ffd700;
    --racing-danger: #ff0844;
    --racing-warning: #ffbe0b;
    --racing-white: #f8f9fa;
    --racing-gray: #6c757d;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--racing-accent) 0%, var(--racing-accent-2) 100%);
    --gradient-dark: linear-gradient(135deg, var(--racing-black) 0%, var(--racing-dark-2) 100%);
    --gradient-danger: linear-gradient(135deg, #ff0844 0%, #ff6b6b 100%);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xxl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-pill: 50px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.2);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.3);
    --shadow-neon: 0 0 20px rgba(255,234,0,0.5);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--racing-black);
    color: var(--racing-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,234,0,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,215,0,0.03) 0%, transparent 50%);
    animation: bgPulse 10s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgPulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1rem, 2vw, 1.25rem); }
h6 { font-size: clamp(0.9rem, 1.5vw, 1.1rem); }

/* === UTILITY CLASSES === */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-neon {
    color: var(--racing-accent);
    text-shadow: 0 0 10px rgba(255,234,0,0.5);
}

/* === BUTTONS === */
.btn-racing {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--gradient-primary);
    color: #0b0b0d !important;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md), var(--shadow-neon);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-racing::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn-racing:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(255,234,0,0.7);
    color: #0b0b0d !important;
}

.btn-racing:hover::before {
    opacity: 1;
}

.btn-racing:active {
    transform: translateY(0);
    color: #0b0b0d !important;
}

.btn-racing-outline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: transparent;
    color: var(--racing-accent);
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid var(--racing-accent);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-racing-outline:hover {
    background: var(--racing-accent);
    color: var(--racing-black);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 25px rgba(255,234,0,0.6);
}

.btn-racing-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px rgba(255,8,68,0.3);
}

.btn-racing-lg {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
    white-space: nowrap;
}

.btn-racing, .btn-racing-outline, .btn-racing-danger {
    white-space: nowrap;
}

/* === YELLOW/WARNING ELEMENTS - FORCE BLACK TEXT === */
/* Apenas backgrounds OPACOS ou SEMI-OPACOS (> 0.5) devem ter texto preto */
.bg-warning,
.badge-warning,
.nav-link.active,
.nav-tabs .nav-link.active,
.sidebar-badge.live,
button[style*="background: linear-gradient"][style*="#fbbf24"],
button[style*="background: linear-gradient"][style*="#ffea00"],
button[style*="background:#fbbf24"],
button[style*="background:#ffea00"],
a[style*="background: linear-gradient"][style*="#fbbf24"],
a[style*="background: linear-gradient"][style*="#ffea00"],
a[style*="background:#fbbf24"],
a[style*="background:#ffea00"],
div[style*="background: linear-gradient"][style*="#ffea00"],
div[style*="background:#ffea00"] {
    color: #000 !important;
}

/* Força texto preto em elementos com background amarelo OPACO */
*[style*="background: #ffea00"]:not([style*="rgba(255,234,0,0.0"]):not([style*="rgba(255,234,0,0.1"]):not([style*="rgba(255, 234, 0, 0.0"]):not([style*="rgba(255, 234, 0, 0.1"]),
*[style*="background:#ffea00"]:not([style*="rgba(255,234,0,0.0"]):not([style*="rgba(255,234,0,0.1"]):not([style*="rgba(255, 234, 0, 0.0"]):not([style*="rgba(255, 234, 0, 0.1"]),
*[style*="background: rgba(255,234,0,0.9"],
*[style*="background: rgba(255,234,0,0.8"],
*[style*="background: rgba(255,234,0,0.7"],
*[style*="background: rgba(255,234,0,0.6"],
*[style*="background: rgba(255, 234, 0, 0.9"],
*[style*="background: rgba(255, 234, 0, 0.8"],
*[style*="background: rgba(255, 234, 0, 0.7"],
*[style*="background: rgba(255, 234, 0, 0.6"],
*[style*="background: linear-gradient"][style*="#ffea00"],
*[style*="background: linear-gradient"][style*="#fbbf24"],
.sidebar-icon-racing {
    color: #000 !important;
}

/* Força ícones e SVGs dentro de elementos amarelos OPACOS serem pretos */
*[style*="background: #ffea00"]:not([style*="rgba(255,234,0,0.0"]):not([style*="rgba(255,234,0,0.1"]) i,
*[style*="background:#ffea00"]:not([style*="rgba(255,234,0,0.0"]):not([style*="rgba(255,234,0,0.1"]) i,
*[style*="background: rgba(255,234,0,0.9"] i,
*[style*="background: rgba(255,234,0,0.8"] i,
*[style*="background: rgba(255, 234, 0, 0.9"] i,
*[style*="background: rgba(255, 234, 0, 0.8"] i,
*[style*="background: linear-gradient"][style*="#ffea00"] i,
*[style*="background: linear-gradient"][style*="#fbbf24"] i,
.sidebar-icon-racing i,
.sidebar-icon-racing svg,
.bg-warning i,
.bg-warning svg,
.nav-link.active i,
.nav-link.active svg {
    color: #000 !important;
}

/* === CARDS === */
.card-racing {
    background: var(--gradient-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.card-racing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card-racing:hover {
    transform: translateY(-4px);
    border-color: rgba(255,234,0,0.3);
    box-shadow: var(--shadow-xl), var(--shadow-neon);
}

.card-racing:hover::before {
    opacity: 1;
}

/* === BADGES === */
.badge-racing {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: rgba(255,234,0,0.15);
    border: 1px solid rgba(255,234,0,0.3);
    border-radius: var(--radius-pill);
    color: var(--racing-accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-racing-danger {
    background: rgba(255,8,68,0.15);
    border-color: rgba(255,8,68,0.3);
    color: var(--racing-danger);
}

.badge-racing-warning {
    background: rgba(255,190,11,0.15);
    border-color: rgba(255,190,11,0.3);
    color: var(--racing-warning);
}

/* === INPUTS === */
.input-racing {
    width: 100%;
    padding: var(--space-md);
    background: var(--racing-dark-2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--racing-white);
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.input-racing:focus {
    outline: none;
    border-color: var(--racing-accent);
    box-shadow: 0 0 0 3px rgba(255,234,0,0.1);
}

.input-racing::placeholder {
    color: var(--racing-gray);
}

/* === GRID SYSTEM === */
.grid-racing {
    display: grid;
    gap: var(--space-lg);
}

/* Grids - se adaptam ao espaço disponível automaticamente */
/* Usa min(100%, Xpx) para evitar overflow e permitir apenas 1 coluna quando necessário */
.grid-racing-2 { 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); 
}
.grid-racing-3 { 
    grid-template-columns: repeat(3, 1fr); 
}
.grid-racing-4 { 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); 
}

/* Mobile: sempre 1 coluna */
@media (max-width: 767px) {
    .grid-racing-2,
    .grid-racing-3,
    .grid-racing-4 {
        grid-template-columns: 1fr;
    }
}

/* === ANIMATIONS === */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes neonPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255,234,0,0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255,234,0,0.6), 0 0 30px rgba(255,234,0,0.3);
    }
}

/* Apply animations */
.animate-slide-up {
    animation: slideInUp 0.6s ease;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease;
}

.animate-fade {
    animation: fadeIn 0.6s ease;
}

/* === RACING STRIPES === */
.racing-stripes {
    position: relative;
}

.racing-stripes::after {
    content: '';
    position: absolute;
    top: 50%;
    right: var(--space-lg);
    width: 60px;
    height: 40px;
    background: 
        linear-gradient(90deg, transparent 0px, var(--racing-accent) 2px, transparent 3px) 0 0,
        linear-gradient(90deg, transparent 0px, var(--racing-accent) 2px, transparent 3px) 0 8px,
        linear-gradient(90deg, transparent 0px, var(--racing-accent) 2px, transparent 3px) 0 16px;
    background-size: 20px 8px;
    opacity: 0.2;
    transform: translateY(-50%) skewX(-15deg);
}

/* === STAT DISPLAY === */
.stat-racing {
    text-align: center;
    padding: var(--space-lg);
}

.stat-racing-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.stat-racing-label {
    font-size: 0.9rem;
    color: var(--racing-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* === LOADING SPINNER === */
.loading-racing {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--racing-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    :root {
        --space-lg: 1rem;
        --space-xl: 1.5rem;
        --space-xxl: 2rem;
    }
    
    .grid-racing-2,
    .grid-racing-3,
    .grid-racing-4 {
        grid-template-columns: 1fr;
    }
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--racing-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--racing-dark-2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--racing-accent);
}

/* === FORM CONTROLS === */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="date"],
input[type="time"],
select,
textarea {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    width: 100%;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--racing-accent) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 234, 0, 0.1);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Select dropdown styling */
select option {
    background: var(--racing-dark-2);
    color: #ffffff;
}

/* File input styling */
input[type="file"] {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 0.5rem 0;
}

input[type="file"]::file-selector-button {
    background: var(--gradient-primary);
    color: var(--racing-black);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-right: 1rem;
}

input[type="file"]::file-selector-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 234, 0, 0.3);
}

/* Checkbox styling */
input[type="checkbox"] {
    width: auto !important;
    accent-color: var(--racing-accent);
    cursor: pointer;
}

.form-check-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.form-check-input:checked {
    background-color: var(--racing-accent) !important;
    border-color: var(--racing-accent) !important;
}

/* Label styling */
.form-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

/* Disabled state */
.form-control:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
