/* ===================================
   ANIMATIONS AND TRANSITIONS
   Inspired by professional design
   =================================== */

/* ===================================
   CSS CUSTOM PROPERTIES FOR ANIMATIONS
   =================================== */

:root {
    --easing-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --easing-slow: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    --duration-fast: 200ms;
    --duration-medium: 400ms;
    --duration-slow: 600ms;
    --duration-very-slow: 1000ms;
}

/* ===================================
   PAGE LOAD ANIMATIONS
   =================================== */

/* Fade in animation for main content */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===================================
   SCROLL ANIMATIONS
   =================================== */

/* Floating scroll indicator */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.scroll-indicator {
    animation: float 2s ease-in-out infinite;
}

.scroll-arrow {
    transition: transform var(--duration-medium) var(--easing-smooth);
}

.scroll-indicator:hover .scroll-arrow {
    transform: translateY(5px);
}

/* Pulse animation for scroll indicator */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===================================
   ALBUM CARD ANIMATIONS
   =================================== */

/* Card hover effects */
/* Album animations now handled by album-grid.css for consistency */

/* ===================================
   TEXT ANIMATIONS
   =================================== */

/* Typewriter effect for hero text */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.hero-title.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--color-purple);
    white-space: nowrap;
    animation: 
        typewriter 3s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-purple);
    }
}

/* Text highlight animation */
.highlight {
    position: relative;
    transition: color var(--duration-medium) var(--easing-smooth);
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-purple);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--duration-medium) var(--easing-smooth);
}

.highlight:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ===================================
   FORM ANIMATIONS
   =================================== */

/* Input focus animations */
.email-input {
    transition: 
        box-shadow var(--duration-fast) var(--easing-smooth),
        transform var(--duration-fast) var(--easing-smooth);
}

.email-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 181, 230, 0.3);
}

/* Submit button animation */
.submit-btn {
    transition: 
        background-color var(--duration-fast) var(--easing-smooth),
        transform var(--duration-fast) var(--easing-smooth);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-slow) var(--easing-smooth);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: scale(0.98);
}

/* ===================================
   NAVIGATION ANIMATIONS
   =================================== */

/* Header slide down */
.header {
    transform: translateY(-100%);
    animation: slideDown var(--duration-medium) var(--easing-smooth) forwards;
}

@keyframes slideDown {
    to {
        transform: translateY(0);
    }
}

/* Menu toggle animation */
.menu-toggle {
    transition: transform var(--duration-fast) var(--easing-smooth);
}

.menu-toggle:hover {
    transform: scale(1.05);
}

/* Menu text swap animation */
.menu-text,
.close-text {
    transition: opacity var(--duration-fast) var(--easing-smooth);
}

.menu-open .menu-text {
    opacity: 0;
}

.menu-open .close-text {
    opacity: 1;
    display: block;
}

/* ===================================
   LOADING ANIMATIONS
   =================================== */

/* Shimmer effect for loading images */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--color-purple);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* ===================================
   SECTION REVEAL ANIMATIONS
   =================================== */

/* Intersection Observer animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: 
        opacity var(--duration-slow) var(--easing-smooth),
        transform var(--duration-slow) var(--easing-smooth);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for album cards */
.album-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp var(--duration-medium) var(--easing-smooth) forwards;
}

.album-card:nth-child(1) { animation-delay: 0ms; }
.album-card:nth-child(2) { animation-delay: 100ms; }
.album-card:nth-child(3) { animation-delay: 200ms; }
.album-card:nth-child(4) { animation-delay: 300ms; }
.album-card:nth-child(5) { animation-delay: 400ms; }
.album-card:nth-child(6) { animation-delay: 500ms; }

/* ===================================
   SOCIAL LINKS ANIMATIONS
   =================================== */

.social-link {
    transition: 
        transform var(--duration-fast) var(--easing-bounce),
        background-color var(--duration-fast) var(--easing-smooth);
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
}

.social-link svg {
    transition: transform var(--duration-fast) var(--easing-smooth);
}

.social-link:hover svg {
    transform: rotate(5deg);
}

/* ===================================
   FOOTER ANIMATIONS
   =================================== */

.footer {
    animation: slideInFromLeft var(--duration-slow) var(--easing-smooth);
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */

/* Will-change properties for better performance */
.album-card,
.album-image img,
.scroll-indicator,
.social-link {
    will-change: transform;
}

.hero-title,
.album-content {
    will-change: opacity, transform;
}

/* ===================================
   REDUCED MOTION SUPPORT
   =================================== */

@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;
    }
    
    .scroll-indicator {
        animation: none;
    }
    
    .album-card:hover {
        transform: none;
    }
    
    .album-image img {
        transition: none;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ===================================
   HIGH PERFORMANCE MODE
   =================================== */

@media (prefers-reduced-data: reduce) {
    /* Disable complex animations on slower connections */
    .album-image img {
        transition: none;
    }
    
    .shimmer,
    .typewriter {
        animation: none;
    }
}

/* ===================================
   MOBILE SPECIFIC ANIMATIONS
   =================================== */

@media (max-width: 767px) {
    /* Simpler animations for mobile */
    .album-card:hover {
        transform: translateY(-4px);
    }
    
    .album-image img {
        transition-duration: var(--duration-fast);
    }
    
    /* Touch feedback */
    .album-card:active {
        transform: scale(0.98);
    }
    
    .social-link:active {
        transform: scale(0.95);
    }
}

/* ===================================
   HERO SECTION ANIMATIONS
   =================================== */

/* Subtle zoom animation for hero background */
@keyframes heroZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

/* Hero brand fade in animation */
@keyframes heroBrandFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply brand animation */
.hero-brand-text {
    animation: heroBrandFadeIn 1.2s ease-out 0.5s both;
}

/* ===================================
   DARK MODE ANIMATIONS
   =================================== */

@media (prefers-color-scheme: dark) {
    .shimmer {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    }
}