@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Plus+Jakarta+Sans:wght@300;400;500;700&display=swap');

:root {
    --bg-main: #06060c;
    --bg-card: rgba(13, 13, 25, 0.7);
    --bg-card-hover: rgba(20, 20, 38, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(168, 85, 247, 0.4);
    --primary: #a855f7;
    --primary-glow: rgba(168, 85, 247, 0.35);
    --secondary: #06b6d4;
    --secondary-glow: rgba(6, 182, 212, 0.35);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.35);
    --success: #10b981;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
}

body {
    background: radial-gradient(circle at 50% 50%, #111126 0%, #030307 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.6);
}

/* Glassmorphism Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary) 70%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* Grid Layout */
.app-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 968px) {
    .app-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 15px 40px -10px rgba(168, 85, 247, 0.15);
}

/* Title in card */
.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Wheel Container Visuals */
.wheel-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
}

.wheel-outer-glow {
    position: absolute;
    width: 94%;
    height: 94%;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 50%, var(--primary-glow) 100%);
    box-shadow: 0 0 40px 10px var(--primary-glow);
    pointer-events: none;
    z-index: 1;
}

.wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 2;
    transform: rotate(0deg);
}

/* Pointer pointing down at top center */
.wheel-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    z-index: 10;
    filter: drop-shadow(0 0 8px var(--primary));
    pointer-events: none;
}

.wheel-pointer svg {
    width: 100%;
    height: 100%;
    fill: #ffffff;
}

/* Center pin */
.wheel-center-pin {
    position: absolute;
    width: 48px;
    height: 48px;
    background: radial-gradient(circle, #ffffff 0%, #1e1b4b 60%, #03001e 100%);
    border: 3px solid var(--primary);
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 0 15px var(--primary);
    pointer-events: none;
}

/* Winner Banner Overlay */
.winner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 3, 7, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.winner-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.winner-modal {
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(10, 10, 20, 0.95));
    border: 2px solid var(--primary);
    box-shadow: 0 0 50px var(--primary-glow);
    padding: 3rem 2rem;
    border-radius: 28px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    transform: scale(0.85);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-overlay.active .winner-modal {
    transform: scale(1);
}

.winner-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    font-weight: 700;
}

.winner-name {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 2rem;
    word-wrap: break-word;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(255, 255, 255, 0.06);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Select element styling */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f3f4f6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* Switch Option Group */
.radio-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.radio-btn {
    flex: 1;
    position: relative;
}

.radio-btn input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-btn label {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.radio-btn input:checked + label {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(168, 85, 247, 0.5), 0 0 15px var(--secondary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-group {
    display: flex;
    gap: 1rem;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-success .badge-pulse {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.5s infinite;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-warning .badge-pulse {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.5;
    }
}

/* Connection Info and Stats */
.stats-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.stats-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-value {
    font-weight: 700;
    color: #ffffff;
}

/* List of current options on Admin side */
.options-list {
    margin-top: 1rem;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.option-item:last-child {
    border-bottom: none;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.option-item-text {
    font-weight: 500;
}

.option-item-delete {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.option-item-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Centered view wrapper for simple pages */
.view-centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 12rem);
}
