@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --deep-space: #090310;
    --nebula-purple: #1f1035;
    --mystic-gold: #e2b740;
    --ethereal-white: #f8fafc;
    --glass-border: rgba(255, 255, 255, 0.08);
}

* { font-family: 'Inter', sans-serif; }
h1, h2, h3, h4, .title { font-family: 'Cormorant Garamond', serif; letter-spacing: 0.05em; }

body { 
    background-color: var(--deep-space);
    background-image: radial-gradient(circle at 50% 0%, #1a0b2e 0%, #05020a 100%);
    color: var(--ethereal-white);
    overflow-x: hidden;
    margin: 0;
}

#cosmosCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* --- ANIMAZIONI CSS --- */
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-20px); } }
@keyframes breathe { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.animate-fade-in { animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.animate-float { animation: float 8s ease-in-out infinite; }
.animate-breathe { animation: breathe 5s ease-in-out infinite; }

/* --- GLASSMORPHISM PREMIUM --- */
.glass {
    background: rgba(20, 10, 30, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-panel {
    background: linear-gradient(135deg, rgba(30, 15, 45, 0.6), rgba(10, 5, 15, 0.8));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(226, 183, 64, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
    position: relative;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.glass-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(226, 183, 64, 0.08),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1; /* Above background, but we need to ensure content is above this. Elements inside glass-panel already have relative/z-10 */
}

.glass-panel:hover::before {
    opacity: 1;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.1), 0 0 40px rgba(226, 183, 64, 0.05);
}

/* --- AMBIENT GLOW --- */
.ambient-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    filter: blur(50px);
    pointer-events: none;
    z-index: -1;
}

/* --- UI ELEMENTS --- */
.btn-mystic {
    background: linear-gradient(135deg, #e2b740, #b8860b);
    color: #05020a;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(226, 183, 64, 0.3);
}

.btn-mystic::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    left: -100%;
}

.btn-mystic:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 30px rgba(226, 183, 64, 0.5); 
}

.btn-mystic:hover::after {
    left: 100%;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(226, 183, 64, 0.2);
    color: #e2b740;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}
.btn-ghost:hover { 
    background: rgba(226, 183, 64, 0.1); 
    border-color: #e2b740; 
    color: #fff; 
    box-shadow: 0 0 15px rgba(226, 183, 64, 0.2);
}

.text-gold { color: #e2b740; }
.gradient-text {
    background: linear-gradient(to right, #e2b740, #ffeb99, #e2b740);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientShift 4s ease infinite;
}

/* --- HDC PRO LAYOUT --- */
.planet-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem; transition: background 0.3s, padding-left 0.3s;
}
.planet-row:hover { background: rgba(226, 183, 64, 0.08); padding-left: 20px; }

.planet-symbol { font-family: 'Segoe UI Symbol', sans-serif; width: 28px; text-align: center; font-size: 1.2rem; }

.gate-badge {
    background: rgba(226, 183, 64, 0.15); border: 1px solid rgba(226, 183, 64, 0.4);
    padding: 3px 10px; border-radius: 20px; font-weight: 600; font-size: 0.85rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.design-text { color: #ff8a8a; }
.personality-text { color: #b0c4de; }
.design-border { border-left: 3px solid #ff8a8a; }
.personality-border { border-right: 3px solid #b0c4de; }

@media (min-width: 1024px) {
    .rave-grid { display: grid; grid-template-columns: 300px 1fr 300px; gap: 40px; align-items: start; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--deep-space); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--mystic-gold); }

/* --- MOBILE MENU --- */
.mobile-menu {
    position: fixed; top: 0; right: 0; bottom: 0; width: 85%; max-width: 360px;
    background: linear-gradient(135deg, rgba(26, 11, 46, 0.98), rgba(15, 5, 24, 0.99));
    backdrop-filter: blur(40px); z-index: 100;
    transform: translateX(100%); transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex; flex-direction: column; padding: 2.5rem;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    border-left: 1px solid rgba(255,255,255,0.05);
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); z-index: 99;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.mobile-menu-overlay.is-open { opacity: 1; pointer-events: auto; }

/* Geoapify Fixes */
.geoapify-autocomplete-items {
    background: rgba(15, 5, 24, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--mystic-gold);
    border-radius: 12px;
    margin-top: 8px;
    overflow: hidden;
    color: white; z-index: 50;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.geoapify-autocomplete-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}
.geoapify-autocomplete-item:hover { background-color: rgba(226, 183, 64, 0.2); }

/* --- ULTRA PREMIUM ADDITIONS --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    grid-auto-flow: dense;
}
.bento-large { grid-column: span 2; }
@media (max-width: 768px) { .bento-large { grid-column: span 1; } }

.noise-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
    mix-blend-mode: overlay;
}

.holo-line {
    stroke-dasharray: 8 12;
    animation: dash-flow 1.5s linear infinite;
}
@keyframes dash-flow {
    from { stroke-dashoffset: 20; }
    to { stroke-dashoffset: 0; }
}

.holo-glow {
    animation: holo-pulse 3s ease-in-out infinite alternate;
}
@keyframes holo-pulse {
    from { filter: drop-shadow(0 0 4px rgba(226, 183, 64, 0.5)); }
    to { filter: drop-shadow(0 0 15px rgba(226, 183, 64, 1)); }
}

.glass-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 50%;
    border-top-color: rgba(226, 183, 64, 0.5);
    animation: spin-slow 20s linear infinite;
    pointer-events: none;
}
.glass-ring-2 {
    animation: spin-slow 30s linear infinite reverse;
    border-bottom-color: rgba(226, 183, 64, 0.3);
}

.scroll-fade {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.scroll-fade.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.editorial-number {
    position: absolute;
    top: -30px;
    right: 10px;
    font-size: 10rem;
    font-family: 'Cormorant Garamond', serif;
    color: rgba(255,255,255,0.02);
    pointer-events: none;
    line-height: 1;
    z-index: 0;
}
