:root {
    --primary-cosmic: #1a0033;
    --secondary-cosmic: #4a0e4e;
    --accent-gold: #ffd700;
    --accent-lotus: #ff6b9d;
    --accent-blue: #48dbfb;
    --text-light: #f0f0f0;
    --text-dark: #1a1a1a;
    --card-bg: rgba(26, 0, 51, 0.85);
    --gradient-divine: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-cosmic: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-enlightenment: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

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

body {
    font-family: 'Noto Sans', sans-serif;
    background: var(--primary-cosmic);
    color: var(--text-light);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

#cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.star-field {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 80px 10px, white, transparent),
        radial-gradient(2px 2px at 130px 80px, white, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: drift 200s linear infinite;
    opacity: 0.5;
}

.nebula {
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, 
        rgba(138, 43, 226, 0.1) 0%, 
        rgba(30, 144, 255, 0.05) 40%, 
        transparent 70%);
    animation: rotate 300s linear infinite;
}

.quantum-field {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.01) 2px,
            rgba(255, 255, 255, 0.01) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.01) 2px,
            rgba(255, 255, 255, 0.01) 4px
        );
    animation: quantum-shift 10s ease-in-out infinite;
}

@keyframes drift {
    from { transform: translateX(0); }
    to { transform: translateX(-200px); }
}

@keyframes rotate {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(360deg) scale(1.2); }
}

@keyframes quantum-shift {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.1; }
}

#divine-header {
    background: linear-gradient(180deg, 
        rgba(26, 0, 51, 0.95) 0%, 
        rgba(74, 14, 78, 0.8) 100%);
    backdrop-filter: blur(20px);
    padding: 2rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.header-aura {
    text-align: center;
    margin-bottom: 2rem;
}

.site-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.sanskrit {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    background: var(--gradient-enlightenment);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: glow 3s ease-in-out infinite;
}

.english {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-lotus));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1rem;
    color: var(--accent-blue);
    letter-spacing: 3px;
    text-transform: uppercase;
}

@keyframes glow {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 20px rgba(255, 215, 0, 0.5)); }
    50% { filter: brightness(1.2) drop-shadow(0 0 30px rgba(255, 215, 0, 0.8)); }
}

.ethereal-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-orb {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05)),
                      var(--gradient-divine);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-orb::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.nav-orb:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.4);
}

.nav-orb:hover::before {
    width: 100%;
    height: 100%;
}

.nav-orb.active {
    background: var(--gradient-divine);
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.6);
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.search-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.search-input:focus ~ .search-glow {
    opacity: 1;
}

#gallery-container {
    min-height: 80vh;
    padding: 3rem 1rem;
}

.loading-mandala {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.mandala-spinner {
    width: 200px;
    height: 200px;
    animation: spin 10s linear infinite;
}

.mandala-spinner circle:nth-child(1) {
    animation: pulse 2s ease-in-out infinite;
}

.mandala-spinner circle:nth-child(2) {
    animation: pulse 2s ease-in-out infinite 0.5s;
}

.mandala-spinner circle:nth-child(3) {
    animation: pulse 2s ease-in-out infinite 1s;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.3; stroke-width: 2; }
    50% { opacity: 1; stroke-width: 4; }
}

.loading-text {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--accent-gold);
    animation: fade-pulse 2s ease-in-out infinite;
}

@keyframes fade-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.deity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.deity-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.deity-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.deity-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(138, 43, 226, 0.4);
}

.deity-card:hover::before {
    opacity: 1;
}

.deity-svg-container {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, 
        rgba(255, 255, 255, 0.05) 0%, 
        transparent 70%);
    position: relative;
    overflow: hidden;
}

.deity-aura {
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, var(--aura-color, rgba(255, 215, 0, 0.2)), transparent);
    animation: aura-pulse 4s ease-in-out infinite;
}

@keyframes aura-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.deity-details {
    padding: 1.5rem;
}

.deity-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-lotus));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.deity-epithet {
    font-size: 0.9rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.deity-description {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.deity-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--accent-gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 30px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modal-appear 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--accent-gold);
    transform: rotate(90deg);
}

.modal-deity-container {
    padding: 3rem;
}

#modal-svg-container {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    background: radial-gradient(ellipse at center, 
        rgba(255, 255, 255, 0.05) 0%, 
        transparent 70%);
    border-radius: 20px;
}

.deity-info {
    text-align: center;
}

#modal-deity-name {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: var(--gradient-enlightenment);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#modal-deity-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.deity-attributes {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.attribute {
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: var(--accent-gold);
    font-size: 0.9rem;
}

#floating-controls {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 99;
}

.control-orb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-divine);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.control-orb:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.6);
}

.control-orb:active {
    transform: scale(0.95);
}

#divine-footer {
    background: linear-gradient(180deg, 
        rgba(74, 14, 78, 0.8) 0%,
        rgba(26, 0, 51, 0.95) 100%);
    padding: 3rem 1rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-blessing {
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-family: 'Cinzel', serif;
}

.footer-mantra {
    font-size: 1rem;
    color: var(--accent-blue);
    letter-spacing: 2px;
}

.hidden {
    display: none !important;
}

.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.list-view {
    grid-template-columns: 1fr;
    max-width: 800px;
}

.list-view .deity-card {
    display: flex;
    align-items: center;
}

.list-view .deity-svg-container {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.list-view .deity-details {
    flex-grow: 1;
}

@media (max-width: 768px) {
    .sanskrit {
        font-size: 2rem;
    }
    
    .english {
        font-size: 1.8rem;
    }
    
    .deity-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        border-radius: 20px;
    }
    
    .modal-deity-container {
        padding: 2rem 1rem;
    }
    
    #floating-controls {
        bottom: 1rem;
        right: 1rem;
    }
    
    .control-orb {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .deity-grid {
        grid-template-columns: 1fr;
    }
    
    .ethereal-nav {
        gap: 0.5rem;
    }
    
    .nav-orb {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

.theme-light {
    --primary-cosmic: #f0f0f0;
    --secondary-cosmic: #e0e0e0;
    --text-light: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.95);
}

.theme-light .star-field,
.theme-light .nebula,
.theme-light .quantum-field {
    opacity: 0.1;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}