/* Main Styles - TERRA Cybercafe Menu v2.0 - WOW Edition */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Orbitron:wght@400;700&family=Rajdhani:wght@400;600;700&family=Share+Tech+Mono&display=swap');

/* CSS Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0a0a0f 0%, #050510 50%, #0a0515 100%);
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 243, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(188, 19, 254, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 100, 255, 0.05) 0%, transparent 70%);
    z-index: -1;
    animation: bgPulse 8s ease-in-out infinite;
}

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

/* Floating orbs effect */
.floating-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: floatOrb 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #00f3ff, #0066ff);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #bc13fe, #ff0080);
    bottom: 20%;
    right: 10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #00ff88, #00f3ff);
    top: 60%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(20px, 30px) scale(1.05); }
}

/* No-scroll main app layout */
#main-app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#main-app > nav {
    flex-shrink: 0;
}

#main-app > .main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Compact category cards */
.main-cat-card {
    height: auto;
}

.main-cat-card .relative.h-48 {
    height: 140px !important;
}

@media (min-width: 640px) {
    .main-cat-card .relative.h-48 {
        height: 160px !important;
    }
}

/* Hide scrollbar but allow scroll */
.main-content::-webkit-scrollbar {
    width: 4px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3);
    border-radius: 2px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.5);
}

/* Background Layers */
#video-background,
#image-background,
#gradient-background {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: -3;
    opacity: 0.25;
    object-fit: cover;
}

#image-background {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#gradient-background {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Overlay gradient */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(2, 4, 8, 0.7) 0%,
            rgba(2, 4, 8, 0.5) 50%,
            rgba(2, 4, 8, 0.8) 100%),
        radial-gradient(circle at 50% 50%,
            rgba(0, 243, 255, 0.03) 0%,
            transparent 50%);
    z-index: -2;
    pointer-events: none;
}

/* Canvas container for Matrix effect */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

/* Typography */
.font-cyber {
    font-family: 'Orbitron', sans-serif;
}

.font-mono-tech {
    font-family: 'Share Tech Mono', monospace;
}

/* Glass Panel Effect - Enhanced */
.glass-panel {
    background: linear-gradient(135deg, rgba(15, 20, 40, 0.7) 0%, rgba(10, 15, 30, 0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 243, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(0, 243, 255, 0.05);
}

/* Glass Card with WOW effects */
.glass-card {
    background: linear-gradient(145deg, rgba(20, 25, 45, 0.9), rgba(10, 15, 30, 0.95));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 243, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Animated gradient border */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0), rgba(188, 19, 254, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: all 0.5s ease;
    pointer-events: none;
}

/* Shine sweep effect */
.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.6s;
    pointer-events: none;
}

.glass-card:hover::before {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.5), rgba(188, 19, 254, 0.5));
}

.glass-card:hover::after {
    left: 150%;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(0, 243, 255, 0.4);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 243, 255, 0.2),
        0 0 60px rgba(0, 243, 255, 0.1),
        inset 0 0 20px rgba(0, 243, 255, 0.05);
}

/* Neon Text Effects - Enhanced */
.neon-text {
    text-shadow:
        0 0 5px rgba(0, 243, 255, 0.8),
        0 0 10px rgba(0, 243, 255, 0.6),
        0 0 20px rgba(0, 243, 255, 0.4),
        0 0 40px rgba(0, 243, 255, 0.2);
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% { text-shadow: 0 0 5px rgba(0, 243, 255, 0.8), 0 0 10px rgba(0, 243, 255, 0.6), 0 0 20px rgba(0, 243, 255, 0.4); }
    50% { text-shadow: 0 0 10px rgba(0, 243, 255, 1), 0 0 20px rgba(0, 243, 255, 0.8), 0 0 40px rgba(0, 243, 255, 0.6), 0 0 80px rgba(0, 243, 255, 0.3); }
}

.neon-text-pink {
    text-shadow:
        0 0 5px rgba(188, 19, 254, 0.8),
        0 0 10px rgba(188, 19, 254, 0.6),
        0 0 20px rgba(188, 19, 254, 0.4);
}

/* Slow spin animation for logo */
.animate-spin-slow {
    animation: spinSlow 8s linear infinite;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Cyber button effect */
.cyber-btn-glow {
    position: relative;
    overflow: hidden;
}

.cyber-btn-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(0, 243, 255, 0.3), transparent 30%);
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(30px, 9999px, 10px, 0); }
    5% { clip: rect(80px, 9999px, 5px, 0); }
    10% { clip: rect(10px, 9999px, 90px, 0); }
    15% { clip: rect(50px, 9999px, 20px, 0); }
    20% { clip: rect(10px, 9999px, 60px, 0); }
    100% { clip: rect(70px, 9999px, 30px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(10px, 9999px, 80px, 0); }
    5% { clip: rect(60px, 9999px, 10px, 0); }
    10% { clip: rect(30px, 9999px, 50px, 0); }
    15% { clip: rect(90px, 9999px, 20px, 0); }
    20% { clip: rect(10px, 9999px, 40px, 0); }
    100% { clip: rect(50px, 9999px, 70px, 0); }
}

/* Typing Cursor */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

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

::-webkit-scrollbar-track {
    background: #020408;
}

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00f3ff;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #020408;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
    animation: autoHideLoader 2s forwards;
}

@keyframes autoHideLoader {
    0%, 70% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; pointer-events: none; z-index: -1; }
}

/* Landing Page Styles */
.cyber-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

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

.cyber-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.cyber-btn-ar:hover {
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.3);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Line Clamp for descriptions */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* RTL Support */
[dir="rtl"] .glass-card:hover::before {
    left: auto;
    right: 100%;
}

[dir="rtl"] .cyber-btn:hover::before {
    left: auto;
    right: 100%;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .glass-card {
        padding: 0.75rem;
    }
    
    .glass-card:hover {
        transform: translateY(-2px);
    }
    
    /* Smaller featured badge on mobile */
    .glass-card .absolute.-top-3.-right-3 span {
        width: 1.5rem;
        height: 1.5rem;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 0.625rem;
    }
    
    .glass-card:hover {
        transform: none;
    }
    
    /* Disable hover effects on touch devices */
    .glass-card::before {
        display: none;
    }
    
    /* Smaller border radius */
    .glass-card {
        border-radius: 0.75rem;
    }
    
    /* Reduce blur for performance */
    .glass-panel,
    .glass-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    
    /* Smaller neon effects for performance */
    .neon-text {
        text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
    }
    
    /* Hide decorative elements on small screens */
    .glitch::before,
    .glitch::after {
        display: none;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .glass-card {
        padding: 0.5rem;
    }
    
    body {
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .glass-panel,
    .glass-card {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    #video-background,
    #image-background,
    #gradient-background,
    #canvas-container,
    #loading-overlay {
        display: none;
    }
}
