/**
 * ANRO Website - Theme Styles
 * Background effects, grain, glow, and theme-specific styles
 */

/* ==========================================
   ANIMATED BACKGROUND
   ========================================== */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Gradient Background */
.bg-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 51, 102, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        var(--color-bg-primary);
    transition: background var(--transition-slow);
}

[data-theme="light"] .bg-gradient {
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 51, 102, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(124, 58, 237, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
        var(--color-bg-primary);
}

/* Animated Glow Orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: orbFloat 20s ease-in-out infinite;
    will-change: transform;
}

.bg-orb--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 51, 102, 0.3) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.bg-orb--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.25) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
    animation-duration: 25s;
}

.bg-orb--3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
    top: 40%;
    left: 30%;
    animation-delay: -14s;
    animation-duration: 30s;
}

[data-theme="light"] .bg-orb {
    opacity: 0.3;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* Grid Pattern Overlay */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 70%);
}

[data-theme="light"] .bg-grid {
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

/* Film Grain Effect */
.bg-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    animation: grainShift 0.5s steps(10) infinite;
}

[data-theme="light"] .bg-grain {
    opacity: 0.02;
}

@keyframes grainShift {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* Vignette Effect */
.bg-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

[data-theme="light"] .bg-vignette {
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
}

/* ==========================================
   THEME TOGGLE BUTTON
   ========================================== */
.theme-toggle {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-border-hover);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle__icon {
    position: absolute;
    width: 24px;
    height: 24px;
    transition: all var(--transition-base);
}

.theme-toggle__icon--sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.theme-toggle__icon--moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

[data-theme="light"] .theme-toggle__icon--sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

[data-theme="light"] .theme-toggle__icon--moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

/* ==========================================
   GLOW EFFECTS
   ========================================== */
.glow-text {
    text-shadow: 0 0 20px var(--color-accent-glow),
                 0 0 40px var(--color-accent-glow),
                 0 0 60px var(--color-accent-glow);
}

.glow-box {
    box-shadow: var(--shadow-glow);
}

.glow-box-sm {
    box-shadow: var(--shadow-glow-sm);
}

/* Animated glow border */
.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: var(--color-accent-gradient);
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.glow-border:hover::before {
    opacity: 1;
}

/* ==========================================
   GLASSMORPHISM
   ========================================== */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
}

[data-theme="light"] .glass {
    background: rgba(255, 255, 255, 0.7);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--color-border);
}

[data-theme="light"] .glass-strong {
    background: rgba(255, 255, 255, 0.85);
}

/* ==========================================
   ACCENT LINE DECORATIONS
   ========================================== */
.accent-line {
    position: relative;
}

.accent-line::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--color-accent-gradient);
    border-radius: var(--radius-full);
}

.accent-line--center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* ==========================================
   NOW PLAYING WIDGET
   ========================================== */
.now-playing {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-fixed);
    max-width: 320px;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-base);
    pointer-events: none;
}

.now-playing.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.now-playing__card {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    transition: all var(--transition-base);
}

.now-playing__card:hover {
    border-color: var(--color-accent-primary);
    transform: scale(1.02);
}

.now-playing__thumbnail {
    position: relative;
    width: 80px;
    height: 45px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.now-playing__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.now-playing__play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.now-playing__card:hover .now-playing__play-icon {
    opacity: 1;
}

.now-playing__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.now-playing__label {
    font-size: var(--font-size-xs);
    color: var(--color-accent-primary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    margin-bottom: var(--space-2xs);
}

.now-playing__title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing__close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.now-playing__close:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .now-playing {
        bottom: calc(var(--mobile-nav-height) + var(--space-md));
        right: var(--space-md);
        left: var(--space-md);
        max-width: none;
    }
}
