:root {
    --bg-color: #0f0f13;
    --text-color: #f1f1f1;
    --accent-color: #ff4df0;
    --accent-hover: #d13bc4;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 12px;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradients */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.4;
}

body::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-color), transparent 70%);
    top: -100px;
    left: -100px;
}

body::after {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #86273d, transparent 70%);
    bottom: -200px;
    right: -200px;
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(15, 15, 19, 0.7);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.lang-switch {
    display: flex;
    gap: 0.5rem;
}

.lang-switch a {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-switch a:hover {
    background: var(--card-bg);
    border-color: var(--accent-color);
}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 5rem 1rem;
    min-height: 80vh;
    justify-content: center;
}

.banner-img {
    max-width: 600px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 2rem;
    border: 1px solid var(--card-border);
    transition: transform 0.3s ease;
}

.banner-img:hover {
    transform: scale(1.02);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 2rem;
    color: #ccc;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 77, 240, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 240, 0.5);
}

.btn-secondary {
    background: var(--card-bg);
    color: white;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--glass-blur));
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Glass Cards Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.glass-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

/* Page Contents (Terms, Privacy) */
.page-content {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 3rem;
    max-width: 800px;
    margin: 4rem auto;
}

.page-content h1 {
    color: var(--accent-color);
    margin-bottom: 2rem;
}

.page-content p {
    margin-bottom: 1rem;
    color: #ccc;
}

/* Commands List */
.search-container {
    margin-bottom: 2rem;
    text-align: center;
}

#command-search {
    width: 100%;
    max-width: 500px;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    backdrop-filter: blur(var(--glass-blur));
    outline: none;
    transition: border-color 0.3s ease;
}

#command-search:focus {
    border-color: var(--accent-color);
}

.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.command-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.command-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(255, 77, 240, 0.1);
}

.command-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 0.5rem;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 77, 240, 0.2);
    border-radius: 4px;
}

.command-category {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.command-desc {
    color: #aaa;
    font-size: 0.95rem;
}

/* Categorized Commands */
.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.command-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.expand-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: var(--accent-color);
}

.command-card.active .expand-icon {
    transform: rotate(180deg);
}

.command-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, margin-top 0.3s ease;
    border-top: 1px solid transparent;
}

.command-card.active .command-details {
    max-height: 1000px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top-color: var(--card-border);
}

.detail-item {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alias-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    margin-left: 0.5rem;
}

.subcommands-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.subcommand-item {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.subcommand-item:first-child {
    border-top: none;
    margin-top: 0.5rem;
}

.subcommand-item code {
    color: var(--accent-color);
    font-weight: bold;
    display: block;
    margin-bottom: 0.2rem;
}

.subcommand-item p {
    font-size: 0.85rem;
    color: #999;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
    background: rgba(15, 15, 19, 0.8);
    backdrop-filter: blur(var(--glass-blur));
}

/* Fantasy Royal Background Elements */
.fantasy-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.construct {
    position: absolute;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 77, 240, 0.15), inset 0 0 15px rgba(255, 215, 0, 0.1);
    animation: float 20s infinite ease-in-out alternate;
}

.crystal {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.ring {
    border-radius: 50%;
    border-width: 2px;
    background: transparent;
}

.pillar {
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
    background: linear-gradient(to bottom, rgba(255, 77, 240, 0.15), transparent);
    border: none;
    box-shadow: none;
}

/* Specific Positions & Delays */
.construct-1 { width: 150px; height: 250px; top: 10%; left: 5%; animation-delay: 0s; }
.construct-2 { width: 300px; height: 300px; top: 40%; right: -5%; animation-delay: -5s; border-color: rgba(255, 77, 240, 0.3); }
.construct-3 { width: 80px; height: 400px; bottom: -10%; left: 20%; animation-delay: -2s; }
.construct-4 { width: 100px; height: 180px; top: 20%; right: 15%; animation-delay: -7s; }
.construct-5 { width: 500px; height: 500px; top: -10%; left: -10%; animation-delay: -10s; border-color: rgba(255, 215, 0, 0.1); border-width: 1px; }

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px #ff4df0, 0 0 20px 5px gold;
    animation: twinkle 4s infinite ease-in-out alternate;
}

.sp-1 { top: 15%; left: 30%; animation-delay: 0s; }
.sp-2 { top: 45%; left: 10%; animation-delay: 1s; }
.sp-3 { top: 30%; right: 25%; animation-delay: 2s; }
.sp-4 { top: 60%; right: 10%; animation-delay: 0.5s; }
.sp-5 { top: 80%; left: 40%; animation-delay: 1.5s; }
.sp-6 { top: 25%; right: 45%; animation-delay: 2.5s; }
.sp-7 { top: 75%; right: 35%; animation-delay: 0.8s; }

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-40px) rotate(10deg); }
}

@keyframes twinkle {
    0% { opacity: 0.2; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.5); }
}

/* Page Loader & Transitions */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s;
    opacity: 0;
    visibility: hidden;
}

.page-loader.active {
    opacity: 1;
    visibility: visible;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loader-text {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 8px;
    background: linear-gradient(to right, var(--accent-color) var(--loading-progress, 0%), rgba(255, 255, 255, 0.1) var(--loading-progress, 0%));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: --loading-progress 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(255, 77, 240, 0.3));
    position: relative;
}

/* Fallback for browsers that don't support animated variables */
.loader-text::after {
    content: "RVDiA";
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    color: rgba(255, 255, 255, 0.05);
}

@property --loading-progress {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 0%;
}

main, nav, footer, .fantasy-bg {
    transition: filter 0.5s ease, opacity 0.5s ease;
}

body.loading main, 
body.loading nav, 
body.loading footer,
body.loading .fantasy-bg {
    filter: blur(10px);
    opacity: 0.5;
}

/* Ensure content stays readable */
.page-content {
    animation: fadeInPage 0.8s ease forwards;
}

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

/* Responsive */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .menu-toggle {
        display: flex;
        z-index: 101;
    }

    /* Hamburger Animation */
    #mobile-menu.is-active .bar:nth-child(2) {
        opacity: 0;
    }

    #mobile-menu.is-active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    #mobile-menu.is-active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(15, 15, 19, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease-in-out;
        z-index: 100;
        border-left: 1px solid var(--card-border);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .lang-switch-mobile {
        display: flex !important;
        gap: 1rem;
        margin-top: 2rem;
    }

    .lang-switch-mobile a {
        padding: 0.5rem 1rem;
        border: 1px solid var(--card-border);
        border-radius: 8px;
        color: var(--text-color);
        text-decoration: none;
    }

    .hero h1 {
        font-size: 2.2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }

    .page-content {
        padding: 1.5rem;
        margin: 2rem 1rem;
    }
}
