:root {
    --bg-deep: #050510;
    --accent-gold: #c5a059;
    --accent-purple: #4a148c;
    --ethereal-blue: #1e3a8a;
}

body {
    background: var(--bg-deep);
    color: #e0e0e0;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
}

h1, h2, h3, .mystical-font {
    font-family: 'Cinzel', serif;
}

/* Animated Starfield */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    overflow: hidden;
}

.nebula {
    position: fixed;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(74, 20, 140, 0.15) 0%, rgba(5, 5, 16, 0) 70%);
    filter: blur(100px);
    z-index: -1;
    animation: drift 20s infinite alternate ease-in-out;
}

@keyframes drift {
    from { transform: translate(-20%, -20%); }
    to { transform: translate(20%, 20%); }
}

.glass-nav {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(197, 160, 89, 0.2);
}

.glass-panel {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(197, 160, 89, 0.1);
}

.tool-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(197, 160, 89, 0.1);
}

.tool-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.3);
}

.btn-primary {
    background: var(--accent-gold);
    color: #000;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.5);
}

.text-accent-gold { color: var(--accent-gold); }
.bg-accent-gold { background-color: var(--accent-gold); }
.border-accent-gold { border-color: var(--accent-gold); }

/* Custom tool styles */
.result-box {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 10px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .nebula {
        width: min(600px, 150vw);
        height: min(600px, 150vw);
        filter: blur(80px);
    }

    /* Reduce motion for mobile performance */
    @media (prefers-reduced-motion: reduce) {
        .nebula {
            animation: none;
        }
        .animate-pulse {
            animation: none;
        }
    }

    /* Touch-friendly buttons */
    .btn-primary {
        padding: 1rem 2rem;
        min-height: 44px; /* iOS touch target minimum */
        font-size: 1rem;
        touch-action: manipulation;
    }

    /* Improve readability on small screens */
    .glass-panel {
        backdrop-filter: blur(8px);
    }

    .glass-nav {
        backdrop-filter: blur(8px);
    }

    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Better spacing for mobile */
    main {
        padding: 1rem;
    }

    .tool-card {
        margin-bottom: 1rem;
        padding: 1.5rem;
    }

    /* Ensure text doesn't get too small on mobile */
    h1, h2, h3 {
        line-height: 1.2;
        word-wrap: break-word;
    }

    /* Mobile-specific hero adjustments */
    .min-h-\[80vh\] {
        min-height: 60vh;
    }

    /* Improve touch targets */
    .symbol-tag {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1rem;
        touch-action: manipulation;
    }

    /* Mobile navigation improvements */
    .glass-nav {
        width: 60px; /* Smaller on mobile */
    }

    /* Better mobile padding */
    .p-6 {
        padding: 1rem;
    }

    .p-8 {
        padding: 1.5rem;
    }

    .p-12 {
        padding: 2rem;
    }

    /* Mobile footer improvements */
    footer {
        padding: 2rem 1rem;
    }

    /* Mobile-specific grid adjustments */
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    /* Better mobile text sizing */
    .text-5xl {
        font-size: 2.5rem;
    }

    .text-8xl {
        font-size: 4rem;
    }

    /* Mobile input improvements */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
        -webkit-appearance: none;
        appearance: none;
    }

    /* Better mobile form styling */
    input[type="text"], input[type="email"], textarea {
        background: rgba(15, 23, 42, 0.6);
        border: 1px solid rgba(197, 160, 89, 0.2);
        color: white;
        padding: 1rem;
        transition: all 0.3s ease;
    }

    input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
        border-color: var(--accent-gold);
        box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.1);
        outline: none;
    }

    /* Mobile-specific adjustments for tool cards */
    .tool-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .tool-card:active {
        transform: scale(0.98);
    }

    /* Better mobile navigation */
    .glass-nav {
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    /* Mobile-optimized spacing */
    .space-y-6 > * + * {
        margin-top: 1.5rem;
    }

    .space-y-8 > * + * {
        margin-top: 2rem;
    }

    /* Better mobile text wrapping */
    .leading-relaxed {
        line-height: 1.6;
    }

    /* Mobile-specific font sizes */
    .text-lg {
        font-size: 1.125rem;
    }

    .text-xl {
        font-size: 1.25rem;
    }

    /* Ensure proper viewport handling */
    html {
        height: 100%;
        overflow-x: hidden;
    }

    /* Better mobile link targets */
    a {
        touch-action: manipulation;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .stars {
        background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support (if system prefers dark) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark theme */
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .glass-nav {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    main {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .text-5xl {
        font-size: 2rem;
    }

    .text-8xl {
        font-size: 3rem;
    }

    .tool-card {
        padding: 1rem;
    }

    .glass-panel {
        padding: 1rem;
        margin: 0 0.5rem;
    }

    .btn-primary {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }

    /* Stack navigation links vertically on very small screens */
    .flex.items-center.space-x-4 {
        flex-direction: column;
        gap: 1rem;
    }

    /* Better mobile grid spacing */
    .gap-8 {
        gap: 1rem;
    }

    .gap-4 {
        gap: 0.5rem;
    }

    /* Smaller icons on mobile */
    .text-3xl {
        font-size: 1.5rem;
    }

    /* Better mobile text spacing */
    .tracking-widest {
        letter-spacing: 0.05em;
    }

    /* Mobile-optimized hero section */
    .min-h-\[80vh\] {
        min-height: 50vh;
        padding: 2rem 1rem;
    }

    /* Better mobile footer */
    footer {
        padding: 1rem;
    }
}

/* Landscape orientation on small screens */
@media (max-height: 500px) and (orientation: landscape) {
    .min-h-\[80vh\] {
        min-height: 70vh;
    }

    .glass-nav {
        height: 100vh;
        overflow-y: auto;
    }
}