:root {
    --primary: #f97316; /* Orange */ 
    --primary-hover: #ea580c;
    --secondary: #1f2937;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --text-main: #ffffff;
    --text-muted: #d1d5db;
    --card-bg: rgba(20, 20, 25, 0.7);
    --card-border: rgba(255, 255, 255, 0.15);
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-color: #000;
}

/* Background setup */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('background-image.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
}

/* Header */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.logo {
    height: 60px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

/* Views */
.view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.view.active {
    opacity: 1;
    pointer-events: all;
    position: relative;
}

.hidden {
    display: none !important;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Typography */
h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Buttons */
button {
    font-family: var(--font-main);
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(249, 115, 22, 0.39);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--danger-hover);
}

/* Forms */
input[type="password"], input[type="number"] {
    width: 100%;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.2s ease;
}

input:focus {
    border-color: var(--primary);
}

.login-card {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-card form {
    display: flex;
    flex-direction: column;
}

/* Wheel Container */
.spin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 4rem;
}

.stats-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 1px;
}

.wheel-wrapper {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .wheel-wrapper {
        width: 450px;
        height: 450px;
    }
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--primary);
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    transition: transform 5s cubic-bezier(0.25, 1, 0.25, 1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0,0,0,0.5);
    background-color: #222;
}

/* Slices are created via CSS conic-gradient applied inline in JS, 
   but text labels need absolute positioning inside the wheel */
.wheel-slice-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    color: white;
    width: 50%;
    padding-left: 20px;
    text-align: right;
    padding-right: 20px;
    box-sizing: border-box;
    /* Transformation logic handled in JS based on index */
}

.spin-btn {
    font-size: 1.25rem;
    padding: 1rem 3rem;
    border-radius: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    padding: 1rem;
}

.modal-content {
    max-width: 500px;
    width: 100%;
}

.prize-announcement {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.billing-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.calculation-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.calc-row.highlight {
    color: #4ade80; /* Green */
}

.calc-row.total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.25rem;
    font-weight: 700;
}

.error-text {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: -1rem;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Admin Dashboard */
.admin-container {
    width: 100%;
    max-width: 1000px;
    margin-top: 4rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
}

.stat-card h4 {
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.admin-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 992px) {
    .admin-panels {
        grid-template-columns: 1fr 1fr;
    }
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    color: var(--text-muted);
    font-weight: 600;
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 2rem;
    z-index: 100;
    font-weight: 600;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.success { border-color: #4ade80; color: #4ade80; }
.toast.error { border-color: #ef4444; color: #ef4444; }
