/* Enhanced CTF Platform Styles - Ultra Modern */
/* Rich UI with Glassmorphism, Animations, and Micro-interactions */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --fire-gradient: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 50%, #ff6b6b 100%);
    --gold-gradient: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    --silver-gradient: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #c0c0c0 100%);
    --bronze-gradient: linear-gradient(135deg, #cd7f32 0%, #d4af37 50%, #cd7f32 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.4);
    --glow-primary: 0 0 20px rgba(102, 126, 234, 0.5);
    --glow-success: 0 0 20px rgba(0, 242, 254, 0.5);
    --glow-fire: 0 0 30px rgba(255, 107, 107, 0.6);
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
}

/* Glassmorphism Effects */
.glass-card {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.3);
}

.glass-nav {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

.animated-bg::after {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
    animation: rotate 20s linear infinite reverse;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    min-width: 320px;
    max-width: 450px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    transform: translateX(500px) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.toast.active {
    transform: translateX(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.toast.toast-exit {
    transform: translateX(500px) scale(0.9);
    opacity: 0;
}

.toast-success {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(17, 24, 39, 0.95) 100%);
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(17, 24, 39, 0.95) 100%);
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(17, 24, 39, 0.95) 100%);
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(17, 24, 39, 0.95) 100%);
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.95);
}

.toast-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: rgba(255, 255, 255, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Online Status Indicator */
#online-users {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

#online-users::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-online 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

@keyframes pulse-online {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Loading States */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 200px;
    border-radius: 12px;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Enhanced Button States */
.btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before, .btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before, .btn-secondary:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Smooth Page Transitions */
.page-transition {
    animation: pageIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Card Hover Effects */
.challenge-card {
    position: relative;
    overflow: hidden;
}

.challenge-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    bottom: -50%;
    left: -50%;
    background: linear-gradient(
        to bottom,
        rgba(102, 126, 234, 0) 0%,
        rgba(102, 126, 234, 0.1) 50%,
        rgba(102, 126, 234, 0) 100%
    );
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.6s;
}

.challenge-card:hover::after {
    transform: translateX(100%) rotate(45deg);
}

/* Improved Modal Animations */
.modal-overlay {
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.closing {
    animation: modalFadeOut 0.3s cubic-bezier(0.4, 0, 1, 1);
}

.modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.closing .modal-content {
    animation: modalSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes modalSlideOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }
}

/* Pulse Animation for Important Elements */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Shake Animation for Errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s;
}

/* Lazy Load Image Fade In */
.lazy-image {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Responsive Improvements */
@media (max-width: 640px) {
    .toast-container {
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .toast {
        padding: 12px 16px;
    }
}

/* Floating Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    animation: float 10s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Gradient Text */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(20deg); }
}

/* Buttons */
.btn-primary {
    position: relative;
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.btn-danger {
    background: var(--secondary-gradient);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(245, 87, 108, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

/* Challenge Cards */
.challenge-card {
    position: relative;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.challenge-card:hover::before {
    transform: scaleX(1);
}

.challenge-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.challenge-card.solved {
    border-color: rgba(79, 172, 254, 0.5);
    background: rgba(79, 172, 254, 0.05);
}

.challenge-card.solved::before {
    background: var(--success-gradient);
    transform: scaleX(1);
}

/* Category Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.badge-web { background: rgba(102, 126, 234, 0.2); color: #667eea; border: 1px solid rgba(102, 126, 234, 0.3); }
.badge-crypto { background: rgba(240, 147, 251, 0.2); color: #f093fb; border: 1px solid rgba(240, 147, 251, 0.3); }
.badge-forensics { background: rgba(79, 172, 254, 0.2); color: #4facfe; border: 1px solid rgba(79, 172, 254, 0.3); }
.badge-reverse { background: rgba(250, 112, 154, 0.2); color: #fa709a; border: 1px solid rgba(250, 112, 154, 0.3); }
.badge-pwn { background: rgba(254, 225, 64, 0.2); color: #fee140; border: 1px solid rgba(254, 225, 64, 0.3); }
.badge-misc { background: rgba(156, 163, 175, 0.2); color: #9ca3af; border: 1px solid rgba(156, 163, 175, 0.3); }

.badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Difficulty Indicators */
.difficulty {
    display: flex;
    gap: 4px;
    align-items: center;
}

.difficulty-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.difficulty-dot.active {
    box-shadow: 0 0 8px currentColor;
}

.difficulty-easy .difficulty-dot.active { background: #4ade80; color: #4ade80; }
.difficulty-medium .difficulty-dot.active { background: #fbbf24; color: #fbbf24; }
.difficulty-hard .difficulty-dot.active { background: #ef4444; color: #ef4444; }

/* Modal Animations */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Input Fields */
.input-field, input[type="text"], input[type="password"], input[type="number"], input[type="url"], textarea, select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 18px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.input-field:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="url"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-field::placeholder, input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Modern Select Dropdown */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 48px;
    cursor: pointer;
    font-weight: 500;
}

select:hover {
    border-color: rgba(102, 126, 234, 0.3);
    background-color: rgba(255, 255, 255, 0.07);
}

select option {
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    font-weight: 500;
    border-radius: 8px;
}

select option:hover, select option:checked {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

/* Checkbox Styling */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

input[type="checkbox"]:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Label for checkboxes */
label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

label:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Stats Cards */
.stat-card {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 0.1;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.2);
}

/* Scoreboard Table */
.scoreboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.scoreboard-row {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.scoreboard-row:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.scoreboard-row td {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scoreboard-row td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px 0 0 12px;
}

.scoreboard-row td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0 12px 12px 0;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 16px;
}

.rank-1 { background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%); color: #1f2937; }
.rank-2 { background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%); color: #1f2937; }
.rank-3 { background: linear-gradient(135deg, #cd7f32 0%, #f4a460 100%); color: #1f2937; }

/* Notification Toast */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 14px 18px;
    min-width: 300px;
    max-width: 380px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 2000;
    transform: translateX(450px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 14px;
}

.toast.active {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    border-radius: 20px 0 0 20px;
    transition: all 0.3s ease;
}

.toast-success::before {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.toast-error::before {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.toast-info::before {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: iconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(34, 197, 94, 0.15) 100%);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: white;
    margin: 0;
}

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

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Up Animation */
.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .glass-card {
        padding: 16px;
    }

    .modal {
        padding: 24px;
        width: 95%;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 13px;
    }

    .toast {
        top: 16px;
        right: 16px;
        left: 16px;
        min-width: unset;
        max-width: unset;
        padding: 12px 16px;
    }

    .toast-icon {
        width: 36px;
        height: 36px;
    }

    .toast-message {
        font-size: 13px;
    }
}

/* Dark Theme Specific */
.dark .text-shadow {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Glow Effects */
.glow {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.5); }
    50% { box-shadow: 0 0 40px rgba(102, 126, 234, 0.8); }
}

/* Enhanced Leaderboard Styles */
.leaderboard-row {
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.leaderboard-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, transparent, rgba(102, 126, 234, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.leaderboard-row:hover::before {
    opacity: 1;
}

.leaderboard-row:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(4px) scale(1.01);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.rank-badge {
    position: relative;
    overflow: hidden;
}

.rank-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Top 3 Rank Animations */
.rank-1 {
    animation: goldShimmer 2s ease-in-out infinite;
}

.rank-2 {
    animation: silverShimmer 2s ease-in-out infinite 0.3s;
}

.rank-3 {
    animation: bronzeShimmer 2s ease-in-out infinite 0.6s;
}

@keyframes goldShimmer {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
}

@keyframes silverShimmer {
    0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(192, 192, 192, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 25px rgba(192, 192, 192, 0.8); }
}

@keyframes bronzeShimmer {
    0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(205, 127, 50, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 25px rgba(205, 127, 50, 0.8); }
}

/* Interactive Emojis */
.emoji-bounce {
    display: inline-block;
    animation: emojiBounce 1s ease-in-out infinite;
}

@keyframes emojiBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.emoji-pulse {
    display: inline-block;
    animation: emojiPulse 1.5s ease-in-out infinite;
}

@keyframes emojiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.emoji-rotate {
    display: inline-block;
    animation: emojiRotate 3s linear infinite;
}

@keyframes emojiRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* First Blood Badge */
.first-blood-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    animation: firstBloodPulse 2s ease-in-out infinite;
}

@keyframes firstBloodPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6); }
}

/* Challenge Card Enhancements */
.challenge-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.challenge-card::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    transition: all 0.6s ease;
    pointer-events: none;
}

.challenge-card:hover::after {
    top: -50%;
    left: -50%;
}

.challenge-card:active {
    transform: scale(0.98);
}

/* Hint Card Styles */
.hint-locked {
    position: relative;
    overflow: hidden;
}

.hint-locked::before {
    content: '🔒';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.5;
    animation: lockSwing 2s ease-in-out infinite;
}

@keyframes lockSwing {
    0%, 100% { transform: translateY(-50%) rotate(0deg); }
    25% { transform: translateY(-50%) rotate(-10deg); }
    75% { transform: translateY(-50%) rotate(10deg); }
}

.hint-unlocked {
    animation: unlockReveal 0.6s ease-out;
}

@keyframes unlockReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

/* Score Counter Animation */
.score-counter {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-update {
    animation: scoreUpdate 0.6s ease-out;
}

@keyframes scoreUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); color: #4ade80; }
    100% { transform: scale(1); }
}

/* Button Click Effects */
.btn-primary:active, .btn-secondary:active {
    transform: scale(0.95);
}

/* Loading Spinner Enhancement */
.spinner {
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(102, 126, 234, 0.3);
    animation: spinnerGlow 1s linear infinite;
}

@keyframes spinnerGlow {
    0% { transform: rotate(0deg); box-shadow: 0 0 10px rgba(102, 126, 234, 0.5); }
    100% { transform: rotate(360deg); box-shadow: 0 0 20px rgba(102, 126, 234, 0.8); }
}

/* Success Celebration */
.celebration {
    animation: celebration 0.8s ease-out;
}

@keyframes celebration {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    75% { transform: scale(1.2) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Online Status Indicator */
.online-indicator {
    position: relative;
    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
    }
}

