/*
|--------------------------------------------------------------------------
| GBI Modern Design System (v2026.7)
|--------------------------------------------------------------------------
|
| Core Stylesheet for Admin Panel & Frontend Components.
| Optimized for Bluehost Shared Hosting (Lightweight).
|
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Padauk:wght@400;700&display=swap');

:root {
    /* Color Palette */
    --primary-color: #6C63FF;
    --primary-hover: #5a52d4;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    /* Backgrounds & Text */
    --main-bg: #F4F7FC;
    --card-bg: #FFFFFF;
    --sidebar-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #757575;
    --border-color: #E0E7F1;

    /* Dimensions & Spacing */
    --header-height: 70px;
    --sidebar-width: 260px;
    --card-radius: 12px;
    --input-radius: 8px;
    --input-height: 42px;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    
    /* Typography */
    --font-family: 'Inter', 'Padauk', sans-serif;
}

/* -------------------------------------------------------------------------- */
/* 1. Global Reset & Typography */
/* -------------------------------------------------------------------------- */

body {
    font-family: var(--font-family);
    background-color: var(--main-bg);
    color: var(--text-primary);
    font-size: 0.9rem; /* 14.4px */
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* -------------------------------------------------------------------------- */
/* 2. Admin Layout (Sidebar & Main) */
/* -------------------------------------------------------------------------- */

/* Sidebar Desktop */
@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        padding: var(--header-height) 0 0; /* Height of navbar */
        box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
        width: var(--sidebar-width);
        display: block;
    }

    .main-content {
        margin-left: var(--sidebar-width); /* Offset for fixed sidebar */
        padding: 2rem;
    }
}

/* Sidebar Mobile */
@media (max-width: 991.98px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding-top: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(108, 99, 255, 0.05);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(108, 99, 255, 0.1);
    font-weight: 600;
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* -------------------------------------------------------------------------- */
/* 3. Components (GBI Style) */
/* -------------------------------------------------------------------------- */

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Forms & Inputs */
.form-control, .form-select {
    height: var(--input-height);
    border-radius: var(--input-radius);
    border: 1px solid #DDD;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
    outline: none;
}

label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    height: var(--input-height);
    border-radius: var(--input-radius);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-sm {
    height: 32px;
    font-size: 0.8rem;
    padding: 0 0.75rem;
}

/* Tables */
.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    background-color: #F9FAFB;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: #F9F9F9;
}

/* -------------------------------------------------------------------------- */
/* 4. Spin Wheel Specifics (Frontend) */
/* -------------------------------------------------------------------------- */

.wheel-container {
    position: relative;
    width: 100%;
    max-width: 480px; /* Max size of wheel */
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

canvas#spinWheel {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 50%;
    transition: transform 5s cubic-bezier(0.25, 0.1, 0.25, 1); /* Initial CSS transition fallback */
}

/* The Triangle Pointer */
.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 50px;
    background-color: #333; /* Dark pointer */
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* The Center Spin Button */
.btn-spin-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 0 0 5px rgba(255,255,255,0.8), 0 0 15px rgba(0,0,0,0.2);
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-spin-center:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--primary-color);
    color: white;
}

.btn-spin-center:disabled {
    background: #ccc;
    border-color: #999;
    color: #666;
    cursor: not-allowed;
    transform: translate(-50%, -50%) scale(1);
}

/* Winner Modal Image */
.drop-shadow {
    filter: drop-shadow(0 10px 8px rgba(0,0,0,0.2));
}