:root {
    --primary-purple: #8B5CF6;
    --dark-purple: #6D28D9;
    --light-purple: #A78BFA;
    --neon-purple: #C084FC;
    --gold: #FFD700;
    --cosmic-blue: #00D9FF;
    --bg-dark: #0F0F1E;
    --text-light: #E5E7EB;
    --header-gradient: linear-gradient(135deg, #0a0015, #1a0033, #2d1b69);
    --dropdown-bg: #1a1a2e;
    --dropdown-hover: #16213e;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

.orbitron {
    font-family: 'Orbitron', monospace;
}

.rajdhani {
    font-family: 'Rajdhani', sans-serif;
}

/* Container Styles */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Specific Styling */
.header-main {
    background: var(--header-gradient);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(192, 132, 252, 0.5);
    box-shadow: 0 4px 30px rgba(139, 92, 246, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Form Input Dark Styling */
.form-input {
    width: 100%;
    padding: 12px 16px;
    background-color: rgba(10, 10, 20, 0.9);
    border-radius: 12px;
    color: white;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s;
    font-size: 16px; /* Prevents zoom on iOS */
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--neon-purple);
    background-color: rgba(5, 5, 15, 0.95);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.form-input option {
    background-color: #0a0a14;
    color: white;
    padding: 8px;
}

select.form-input {
    cursor: pointer;
}

/* Background Effects */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
}

.constellation-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    pointer-events: none;
    background-image: 
        radial-gradient(2px 2px at 10% 20%, white, transparent),
        radial-gradient(2px 2px at 30% 70%, #FFD700, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, #00D9FF, transparent);
    background-size: 200px 200px;
    /* Slowed down animation to prevent performance issues */
    animation: stars 600s linear infinite;
}

@keyframes stars {
    from { background-position: 0 0; }
    to { background-position: -200px -200px; }
}

/* Glass Morphism Effect */
.glass-morphism {
    background: rgba(139, 92, 246, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.glass-dark {
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Stat Cards with Animation */
.stat-card {
    background: rgba(139, 92, 246, 0.1);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent);
    animation: pulse 3s ease-in-out infinite;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* Astrology Visualizations */
.astro-wheel {
    width: 250px;
    height: 250px;
    position: relative;
    margin: 0 auto;
    /* Removed infinite rotation to prevent scrolling issues */
}

.planet-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    box-shadow: 0 0 20px currentColor;
    animation: planetPulse 2s ease-in-out infinite;
}

@keyframes planetPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.chinese-diagram {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 2rem;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent);
    border-radius: 50%;
    position: relative;
}

.chinese-element {
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    transition: transform 0.3s;
}

.chinese-element:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* Name Generation Enhancements */
.length-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.length-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.5);
    transition: all 0.3s;
    cursor: pointer;
    color: white;
}

.length-btn:hover {
    background: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.length-btn.active {
    background: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.8);
    transform: scale(1.05);
}

.name-card {
    background: rgba(30, 27, 75, 0.6);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.name-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
    transition: left 0.5s;
}

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

.name-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

/* Neon Effects */
.neon-glow {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5),
               0 0 40px rgba(139, 92, 246, 0.3);
}

.text-glow {
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.8),
                0 0 20px rgba(139, 92, 246, 0.6);
}

.gold-glow {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8),
                0 0 20px rgba(255, 215, 0, 0.6);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple), var(--dark-purple));
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

/* Navigation Tabs */
.nav-tab {
    padding: 10px 20px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-tab.active {
    background: rgba(139, 92, 246, 0.3);
    border-color: var(--neon-purple);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.nav-tab:hover:not(.active) {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.tab-icon-wrapper {
    display: inline-block;
    transition: transform 0.3s;
}

.nav-tab:hover .tab-icon-wrapper {
    transform: rotate(10deg) scale(1.2);
}

/* Map Container */
.map-container {
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(139, 92, 246, 0.3);
    position: relative;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    z-index: 1000;
    background: rgba(10, 10, 20, 0.95);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    min-width: 250px;
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tooltip-content.show {
    display: block;
}

/* Scrollbar Styling */
.scroll-container {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-purple) transparent;
}

.scroll-container::-webkit-scrollbar {
    width: 8px;
}

.scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 4px;
}

/* Loading States */
.skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background-color: rgba(139, 92, 246, 0.1);
    }
    100% {
        background-color: rgba(139, 92, 246, 0.3);
    }
}

/* Utility Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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

.floating {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(2deg); }
    75% { transform: translateY(-5px) rotate(-2deg); }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .glass-morphism {
        border-radius: 15px;
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .header-main h1 {
        font-size: 1.5rem;
    }
    
    .nav-tab {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
    
    .tab-text {
        display: none;
    }
    
    .tab-icon {
        font-size: 1.2rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .map-container {
        height: 250px;
    }
    
    .astro-wheel {
        width: 180px;
        height: 180px;
    }
    
    .planet-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .name-card {
        padding: 1rem;
    }
}

/* iOS Safari Specific Optimizations */
@supports (-webkit-touch-callout: none) {
    /* iOS only */
    .glass-morphism {
        -webkit-backdrop-filter: blur(10px);
    }
    
    .form-input {
        -webkit-appearance: none;
        border-radius: 12px;
    }
    
    input[type="date"],
    input[type="time"] {
        min-height: 44px; /* iOS touch target */
    }
    
    body {
        -webkit-font-smoothing: antialiased;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-primary,
    .btn-secondary,
    .nav-tab {
        -webkit-tap-highlight-color: rgba(139, 92, 246, 0.2);
    }
}

/* Safe area insets for iPhone notch */
@supports (padding: max(0px)) {
    .header-main {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
    
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none !important;
    }
    
    .glass-morphism {
        background: transparent;
        border: 1px solid #ccc;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .glass-morphism {
        border-width: 2px;
    }
    
    .form-input {
        border-width: 2px;
    }
}

/* Dark Mode (already dark by default) */
@media (prefers-color-scheme: light) {
    /* Override for users who prefer light mode */
    .light-mode-adjust {
        filter: invert(1) hue-rotate(180deg);
    }
}