/* TERMGAME EXPRESS - Enhanced Styles with Animated Background */
body {
    font-family: 'Sarabun', sans-serif;
    background-color: #1a1a1a;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Layers */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(45deg, #0a0a0a, #1a1a1a, #2a2a2a, #1a1a1a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 165, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 140, 0, 0.06) 0%, transparent 50%);
    animation: floatingOrbs 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes floatingOrbs {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg); 
        opacity: 0.7; 
    }
    25% { 
        transform: translate(30px, -20px) rotate(5deg); 
        opacity: 0.9; 
    }
    50% { 
        transform: translate(-15px, 15px) rotate(-3deg); 
        opacity: 0.6; 
    }
    75% { 
        transform: translate(-20px, -10px) rotate(3deg); 
        opacity: 0.8; 
    }
}

/* Enhanced Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 25%, #FF8C00 50%, #FFD700 75%, #FFA500 100%);
    background-size: 200% 200%;
    animation: gradientFloat 8s ease-in-out infinite;
    position: relative;
}

@keyframes gradientFloat {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Enhanced Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
    background-color: rgba(42, 42, 42, 0.95);
    border: 1px solid #444;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.6s ease;
}

.card-hover:hover::before {
    left: 100%;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
}

.tab-active {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: 600;
}

.tab-inactive {
    background-color: rgba(42, 42, 42, 0.9);
    color: #FFD700;
    border: 1px solid #444;
    backdrop-filter: blur(10px);
}

.tab-inactive:hover {
    background-color: rgba(58, 58, 58, 0.9);
    border-color: #FFD700;
}

/* Enhanced Loading Animation */
.loading {
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top: 2px solid rgba(255, 165, 0, 0.6);
    animation: spin 2s linear infinite reverse;
}

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

/* Enhanced Dark Card */
.dark-card {
    background: rgba(42, 42, 42, 0.7);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #fff;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.dark-card:hover {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 12px 48px rgba(255, 215, 0, 0.1);
}

/* Enhanced Input Styles */
.dark-input {
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #fff;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.dark-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
    outline: none;
}

.dark-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.yellow-accent {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid #FFD700;
    backdrop-filter: blur(10px);
}

.text-yellow {
    color: #FFD700;
}

.text-orange {
    color: #FFA500;
}

.bg-dark {
    background-color: #1a1a1a;
}

.border-yellow {
    border-color: #FFD700;
}

/* Enhanced Game Card */
.game-card {
    background: rgba(42, 42, 42, 0.7);
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

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

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    border-color: #FFD700;
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.25);
}

.game-card.selected {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
}

/* Enhanced Premium Card */
.premium-card {
    background: rgba(42, 42, 42, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

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

.premium-card:hover::before {
    left: 100%;
}

.premium-card:hover {
    border-color: #FFD700;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(255, 215, 0, 0.2);
}

.premium-card .short-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Transparent Card for Premium Section */
.transparent-card {
    background: rgba(42, 42, 42, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #fff;
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.transparent-card:hover {
    background: rgba(42, 42, 42, 0.4);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 12px 48px rgba(255, 215, 0, 0.1);
}

/* Enhanced Bottom Navigation */
.nav-bottom {
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.95) 0%, rgba(26, 26, 26, 0.95) 100%);
    border-top: 2px solid #FFD700;
    backdrop-filter: blur(20px);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.3);
}

.nav-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #888;
    position: relative;
}

.nav-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #FFD700;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-btn.active {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
    transform: scale(1.1);
}

.nav-btn.active::after {
    width: 80%;
}

.nav-btn:hover {
    color: #FFD700;
    transform: translateY(-3px);
}

/* Button Enhancements */
.btn-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
}

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

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.3);
}

/* Modal Enhancements */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFD700, #FFA500);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FFA500, #FF8C00);
}

/* Glow Effects */
.glow-effect {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.glow-hover:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .game-card {
        margin-bottom: 1rem;
    }
    
    .nav-btn {
        padding: 0.5rem;
    }
    
    .dark-card {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    body::after {
        /* Reduce animation intensity on mobile for performance */
        animation-duration: 30s;
    }
}

@media (max-width: 640px) {
    .gradient-bg {
        animation-duration: 12s; /* Faster animation on small screens */
    }
    
    .nav-btn span:last-child {
        font-size: 0.65rem;
    }
}

@media (min-width: 1024px) {
    .game-card:hover {
        transform: translateY(-10px) scale(1.05);
    }
    
    .premium-card:hover {
        transform: translateY(-8px);
    }
}