/* ============================================
   DREVHE ESPORTS ARENA - PROFESSIONAL DESIGN SYSTEM
   Shadcn-inspired with Drevhe brand alignment
   ============================================ */

:root {
    /* ===== COLOR SYSTEM (Shadcn-inspired) ===== */
    /* Background colors */
    --background: 0 0% 100%;                    /* White background */
    --foreground: 222.2 84% 4.9%;              /* Dark text */

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    /* Brand colors from Drevhe */
    --primary: 230 80% 56%;                     /* #2b41ef - Drevhe Blue */
    --primary-foreground: 210 40% 98%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;

    /* Semantic colors */
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --success: 142.1 76.2% 36.3%;              /* #027a48 */
    --success-foreground: 355.7 100% 97.3%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 230 80% 56%;                        /* Matches primary */

    --radius: 0.5rem;

    /* Drevhe specific colors */
    --drevhe-blue: #2b41ef;
    --drevhe-purple: #4f63f2;
    --drevhe-navy: #141f7a;
    --drevhe-green: #027a48;
    --drevhe-light-blue: #8da6dd;
}

.dark {
    /* Dark mode colors */
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --primary: 230 80% 56%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 230 80% 56%;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    border-color: hsl(var(--border));
}

.esports-wrapper {
    min-height: 100vh;
    background-color: hsl(var(--background));
    font-family: 'Splinesans Variablefont Wght', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: hsl(var(--foreground));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.esports-wrapper h1,
.esports-wrapper h2,
.esports-wrapper h3,
.esports-wrapper h4 {
    font-family: 'Ppcirka', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    color: hsl(var(--foreground));
    margin: 0;
    letter-spacing: -0.02em;
}

.esports-wrapper h1 {
    font-size: 3rem;
    font-weight: 700;
}

.esports-wrapper h2 {
    font-size: 2rem;
    font-weight: 600;
}

.esports-wrapper h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.esports-wrapper h4 {
    font-size: 1.125rem;
    font-weight: 600;
}

.esports-wrapper p {
    font-family: 'Splinesans Variablefont Wght', sans-serif;
    line-height: 1.6;
    font-weight: 400;
    color: hsl(var(--foreground));
}

.text-muted {
    color: hsl(var(--muted-foreground));
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

/* ============================================
   CONTAINER
   ============================================ */
.esports-container {
    max-width: 80rem;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (max-width: 768px) {
    .esports-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.esports-header {
    border-bottom: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.esports-header h1 {
    color: hsl(var(--primary));
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
}

.esports-header p {
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
    margin: 0;
}

.esports-nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.esports-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    background-color: transparent;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s;
}

.esports-nav a:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.esports-nav a.active {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

/* ============================================
   BUTTON SYSTEM (Shadcn-inspired)
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

.btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-color: hsl(var(--border));
}

.btn-secondary:hover {
    background-color: hsl(var(--secondary) / 0.8);
}

.btn-outline {
    background-color: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}

.btn-outline:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-ghost {
    background-color: transparent;
    border-color: transparent;
    color: hsl(var(--foreground));
}

.btn-ghost:hover {
    background-color: hsl(var(--accent));
}

.btn-destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
}

/* ============================================
   CARD SYSTEM (Shadcn-inspired)
   ============================================ */
.card {
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    transition: all 0.2s;
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
}

.card-description {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.card-content {
    padding: 1.5rem;
}

.card-footer {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid hsl(var(--border));
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ============================================
   BADGE SYSTEM
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.badge-default {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.badge-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-color: hsl(var(--border));
}

.badge-outline {
    background-color: transparent;
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}

.badge-success {
    background-color: hsl(var(--success));
    color: hsl(var(--success-foreground));
}

.badge-destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

/* Status badges */
.badge-live {
    background-color: hsl(0 84.2% 60.2%);
    color: white;
    position: relative;
}

.badge-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
    margin-right: 0.375rem;
    animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   TABLE SYSTEM
   ============================================ */
.table-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead {
    border-bottom: 1px solid hsl(var(--border));
}

.table thead tr {
    background-color: hsl(var(--muted) / 0.5);
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: hsl(var(--foreground));
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid hsl(var(--border));
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: hsl(var(--muted) / 0.5);
}

.table th.text-center,
.table td.text-center {
    text-align: center;
}

.table th.text-right,
.table td.text-right {
    text-align: right;
}

/* ============================================
   RANK INDICATORS (Professional)
   ============================================ */
.rank-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.875rem;
}

.rank-1 {
    background: linear-gradient(135deg, hsl(45 93% 47%) 0%, hsl(45 93% 38%) 100%);
    color: hsl(45 5% 15%);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.rank-2 {
    background: linear-gradient(135deg, hsl(0 0% 80%) 0%, hsl(0 0% 65%) 100%);
    color: hsl(0 0% 15%);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.rank-3 {
    background: linear-gradient(135deg, hsl(25 65% 50%) 0%, hsl(25 65% 40%) 100%);
    color: white;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   STATS CARDS
   ============================================ */
.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--card));
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Ppcirka', sans-serif;
    color: hsl(var(--foreground));
    line-height: 1;
}

.stat-description {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    margin-top: 0.5rem;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.input,
.select {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--input));
    background-color: hsl(var(--background));
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    color: hsl(var(--foreground));
}

.input:focus,
.select:focus {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* ============================================
   SEPARATOR
   ============================================ */
.separator {
    height: 1px;
    width: 100%;
    background-color: hsl(var(--border));
    margin: 1.5rem 0;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    border-radius: var(--radius);
    border: 1px dashed hsl(var(--border));
    background-color: hsl(var(--muted) / 0.3);
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.w-full {
    width: 100%;
}

.space-y-1 > * + * {
    margin-top: 0.25rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1 1 0%;
}

.items-start {
    align-items: flex-start;
}

.gap-6 {
    gap: 1.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.hover\:underline:hover {
    text-decoration: underline;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* ============================================
   SECTION SPACING
   ============================================ */
.section {
    margin-bottom: 3rem;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-description {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
    .esports-header h1 {
        font-size: 1.875rem;
    }

    .esports-nav {
        flex-direction: column;
    }

    .esports-nav a {
        width: 100%;
        text-align: center;
    }

    .table {
        font-size: 0.8125rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--muted));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground) / 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground) / 0.5);
}

/* ============================================
   ADDITIONAL UTILITIES
   ============================================ */

/* Position utilities */
.absolute {
    position: absolute;
}

.relative {
    position: relative;
}

.top-3 {
    top: 0.75rem;
}

.right-3 {
    right: 0.75rem;
}

/* Border utilities */
.border-primary {
    border-color: hsl(var(--primary)) !important;
}

.border-destructive {
    border-color: hsl(var(--destructive)) !important;
}

/* Background utilities */
.bg-muted {
    background-color: hsl(var(--muted));
}

.bg-destructive {
    background-color: hsl(var(--destructive) / 0.1);
}

/* Small stat cards */
.stat-card-small {
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
}

.stat-value-small {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label-small {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Card compact */
.card-compact {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    padding: 0.75rem;
}

/* Cursor utilities */
.cursor-pointer {
    cursor: pointer;
}

/* Button ghost variant */
.btn-ghost {
    background: transparent;
    border: none;
    color: hsl(var(--primary));
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.btn-ghost:hover {
    background: hsl(var(--muted));
}

/* Text size utilities */
.text-5xl {
    font-size: 3rem;
    line-height: 1;
}

/* Grid column utilities */
.grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Additional margin utilities */
.mb-8 {
    margin-bottom: 2rem;
}

.mt-5 {
    margin-top: 1.25rem;
}

/* Additional gap utilities */
.gap-5 {
    gap: 1.25rem;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .esports-header,
    .esports-nav,
    button,
    .btn {
        display: none !important;
    }
}
