:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --accent-primary: #00d4ff;
    --accent-secondary: #ff6b9d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #333333;
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #ef4444;
    --shadow: rgba(0, 212, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header - Redesigned */
header {
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 1px solid rgba(51, 51, 51, 0.5);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
}

.nav-links > li {
    position: relative;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(0, 212, 255, 0.1);
}

.nav-links a.active {
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.15);
}

.lang-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

/* User Avatar Dropdown - Redesigned */
.user-avatar-container {
    position: relative;
    display: inline-block;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.user-avatar:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.2);
}

.avatar-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.avatar-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(51, 51, 51, 0.5);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    padding-left: 1.5rem;
}

.dropdown-item-info {
    border-bottom: 1px solid rgba(51, 51, 51, 0.5);
    background: rgba(0, 212, 255, 0.05);
}

.dropdown-item-info:hover {
    background: rgba(0, 212, 255, 0.1);
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-item.danger {
    color: var(--error);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: radial-gradient(circle at center, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.2);
}

.card-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Game Selection */
.game-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.game-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.game-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.game-card:hover img {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
}

.game-card.selected {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
}

.game-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    margin: 0 auto 1rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

th {
    background: var(--bg-tertiary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--accent-primary);
}

td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

tr:hover {
    background: var(--bg-tertiary);
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-error {
    background: var(--error);
    color: white;
}

.badge-pending {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Lottery Wheel */
.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 2rem auto;
    display: inline-block;
}

#lotteryWheel {
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    border: 4px solid var(--accent-primary);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.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: 35px solid var(--accent-primary);
    z-index: 10;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.wheel-spinning {
    pointer-events: none;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Grid Layouts */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

/* Notification System */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    transform: translateX(400px);
    opacity: 0;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-primary);
}

.notification.success::before {
    background: var(--success);
}

.notification.error::before {
    background: var(--error);
}

.notification.warning::before {
    background: var(--warning);
}

.notification.info::before {
    background: var(--accent-primary);
}

@keyframes slideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification.slide-out {
    animation: slideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.notification-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.notification.success .notification-icon {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.notification.error .notification-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.notification.warning .notification-icon {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning);
}

.notification.info .notification-icon {
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-primary);
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-primary);
    width: 100%;
    transform-origin: left;
    animation: progressBar 5s linear forwards;
}

.notification.success .notification-progress {
    background: var(--success);
}

.notification.error .notification-progress {
    background: var(--error);
}

.notification.warning .notification-progress {
    background: var(--warning);
}

@keyframes progressBar {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-info {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.05);
}

.file-upload.dragover {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 4rem;
}

/* Admin Sidebar Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

.admin-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s;
}

.admin-sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.admin-sidebar-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.admin-sidebar-header .admin-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-sidebar-header .admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu-item {
    margin: 0.25rem 0;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.sidebar-menu-link:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

.sidebar-menu-link.active {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

.sidebar-menu-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-menu-link.danger {
    color: var(--error);
}

.sidebar-menu-link.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error);
}

.admin-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    background: var(--bg-primary);
}

.admin-topbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    margin: -2rem -2rem 2rem -2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-topbar h1 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin: 0;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.15);
    border-color: var(--accent-primary);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.stat-card-change {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .nav-links {
        gap: 0.25rem;
    }
    
    .nav-links a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .wheel {
        width: 300px;
        height: 300px;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .admin-topbar {
        padding: 1rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-primary);
}

