/* ========================================
   MADYANTARA - Main Stylesheet
   Komunitas Budaya Majapahit
   ======================================== */

/* ---------- CSS Variables ---------- */
:root {
    /* Colors - Majapahit Theme */
    --color-gold: #e6d098;
    --color-gold-light: #f5e6b8;
    --color-gold-dark: #c9a227;
    --color-red: #8b0000;
    --color-red-light: #a52a2a;
    --color-dark: #1a1a1a;
    --color-darker: #0d0d0d;
    --color-light: #ffffff;
    --color-gray: #888888;
    
    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-body: 'Poppins', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;
    
    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-normal: 0.5s ease;
    --transition-slow: 0.8s ease;
    
    /* Shadows */
    --shadow-gold: 0 0 30px rgba(230, 208, 152, 0.4);
    --shadow-text: 0 0 20px rgba(255, 237, 170, 0.7);
    --shadow-box: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-darker);
    color: var(--color-light);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-gold);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
}

.highlight {
    color: var(--color-gold);
    font-weight: 600;
}

/* ---------- Hero Section ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

/* Video Background */
.hero-video-container {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.hero-background {
    position: absolute;
    inset: 0;
    background: url('../images/hero-bg.jpg') no-repeat center center/cover;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(13, 13, 13, 0.75) 0%,
        rgba(26, 26, 26, 0.65) 50%,
        rgba(139, 0, 0, 0.2) 100%
    );
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: var(--spacing-md);
    max-width: 900px;
}

/* Logo Styling */
.logo-container {
    margin-bottom: var(--spacing-md);
}

.logo {
    width: 140px;
    height: 140px;
    margin: 0 auto var(--spacing-sm);
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(230, 208, 152, 0.5));
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Title Container with Animation */
.title-container {
    position: relative;
    height: clamp(4rem, 10vw, 7rem);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-title {
    position: relative;
    letter-spacing: 8px;
    text-shadow: var(--shadow-text);
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-title .title-latin,
.hero-title .title-aksara {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    animation-duration: 5s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.hero-title .title-latin {
    animation-name: titleSwapLatin;
}

.hero-title .title-aksara {
    font-size: clamp(2.2rem, 5.5vw, 4.2rem);
    animation-name: titleSwapAksara;
    opacity: 0;
    line-height: 1.4;
    padding-bottom: 5px;
}

@keyframes titleSwapLatin {
    0%, 35% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    40%, 45% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    45%, 90% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.05);
    }
    95%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes titleSwapAksara {
    0%, 35% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.05);
    }
    40%, 45% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    45%, 90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    95%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.4rem);
    margin-bottom: var(--spacing-md);
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

.hero-tagline {
    font-size: 1rem;
    color: var(--color-gold-light);
    font-style: italic;
    margin-bottom: var(--spacing-lg);
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
}

/* ---------- Countdown Section ---------- */
.countdown-wrapper {
    margin-bottom: var(--spacing-lg);
    opacity: 0;
    animation: fadeInUp 1s ease 0.7s forwards;
}

.countdown-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: var(--spacing-sm);
    color: var(--color-gold);
}

.countdown {
    display: flex;
    gap: clamp(1rem, 4vw, 2.5rem);
    justify-content: center;
    flex-wrap: wrap;
}

.countdown-item {
    text-align: center;
    min-width: 80px;
    padding: var(--spacing-sm);
    background: rgba(230, 208, 152, 0.1);
    border: 1px solid rgba(230, 208, 152, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    transition: var(--transition-fast);
}

.countdown-item:hover {
    background: rgba(230, 208, 152, 0.2);
    transform: translateY(-5px);
    box-shadow: var(--shadow-gold);
}

.countdown-number {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--color-gold);
    line-height: 1;
}

.countdown-text {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: var(--spacing-xs);
    opacity: 0.8;
}

/* ---------- Sound Button (Below Countdown) ---------- */
.sound-container {
    margin-top: var(--spacing-md);
    opacity: 0;
    animation: fadeInUp 1s ease 0.9s forwards;
}

.btn-sound {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px 28px;
    background: rgba(230, 208, 152, 0.1);
    border: 1px solid rgba(230, 208, 152, 0.4);
    border-radius: 50px;
    color: var(--color-gold);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.btn-sound:hover {
    background: rgba(230, 208, 152, 0.2);
    border-color: var(--color-gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-sound.playing {
    background: var(--color-gold);
    color: var(--color-dark);
}

.btn-sound.playing:hover {
    background: var(--color-gold-light);
}

.sound-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sound-icon.sound-on {
    display: none;
}

.btn-sound.playing .sound-icon.sound-off {
    display: none;
}

.btn-sound.playing .sound-icon.sound-on {
    display: block;
}

.sound-text {
    white-space: nowrap;
}

/* ---------- CTA Button ---------- */
.cta-container {
    opacity: 0;
    animation: fadeInUp 1s ease 0.9s forwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 50px;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: var(--color-dark);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-gold);
    color: var(--color-gold);
}

.btn-outline:hover {
    background: var(--color-gold);
    color: var(--color-dark);
}

/* ---------- Control Buttons ---------- */
.controls {
    position: fixed;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    z-index: 100;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid rgba(230, 208, 152, 0.3);
    color: var(--color-gold);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: var(--color-gold);
    color: var(--color-dark);
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--color-gold);
    color: var(--color-dark);
}

/* Control Tooltip */
.control-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 60px;
    padding: 5px 10px;
    background: var(--color-dark);
    border: 1px solid rgba(230, 208, 152, 0.3);
    border-radius: 5px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.control-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ---------- Particles / Fireflies ---------- */
.particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--color-gold);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: firefly 8s ease-in-out infinite;
    box-shadow: 0 0 10px var(--color-gold), 0 0 20px var(--color-gold);
}

@keyframes firefly {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* ---------- Decorative Elements ---------- */
.ornament {
    position: absolute;
    pointer-events: none;
    opacity: 0.1;
}

.ornament-top-left {
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    border-left: 2px solid var(--color-gold);
    border-top: 2px solid var(--color-gold);
}

.ornament-bottom-right {
    bottom: 0;
    right: 0;
    width: 200px;
    height: 200px;
    border-right: 2px solid var(--color-gold);
    border-bottom: 2px solid var(--color-gold);
}

.ornament-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(230, 208, 152, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 0, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* ---------- Footer ---------- */
.footer {
    position: absolute;
    bottom: var(--spacing-md);
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
    z-index: 10;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(230, 208, 152, 0.1);
    border: 1px solid rgba(230, 208, 152, 0.3);
    color: var(--color-gold);
    transition: var(--transition-fast);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.social-link:hover {
    background: var(--color-gold);
    color: var(--color-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ---------- Scroll Indicator ---------- */
.scroll-indicator {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    opacity: 0;
    animation: fadeIn 1s ease 1.5s forwards;
}

.scroll-indicator span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-indicator .mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--color-gold);
    border-radius: 15px;
    position: relative;
}

.scroll-indicator .mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--color-gold);
    border-radius: 2px;
    animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
    0%, 100% { 
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% { 
        opacity: 0.5;
        transform: translateX(-50%) translateY(10px);
    }
}

/* ---------- Loading Screen ---------- */
.loader {
    position: fixed;
    inset: 0;
    background: var(--color-darker);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-gold);
    letter-spacing: 5px;
    margin-bottom: var(--spacing-md);
    animation: pulse 2s ease-in-out infinite;
}

.loader-bar {
    width: 200px;
    height: 3px;
    background: rgba(230, 208, 152, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.loader-progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
    border-radius: 3px;
    animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
    0% { width: 0; }
    100% { width: 100%; }
}

/* ---------- Responsive Design ---------- */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }
    
    .logo {
        width: 110px;
        height: 110px;
    }
    
    .title-container {
        height: clamp(3.5rem, 12vw, 5rem);
    }
    
    .hero-title {
        letter-spacing: 4px;
    }
    
    .hero-title .title-aksara {
        font-size: clamp(1.8rem, 7vw, 3rem);
        padding-bottom: 8px;
    }
    
    .countdown {
        gap: 0.75rem;
    }
    
    .countdown-item {
        min-width: 65px;
        padding: 0.75rem;
    }
    
    .controls {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
    }
    
    .ornament-top-left,
    .ornament-bottom-right {
        width: 100px;
        height: 100px;
    }
    
    .btn-sound {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .social-link {
        width: 36px;
        height: 36px;
    }
    
    .social-link svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 90px;
        height: 90px;
    }
    
    .title-container {
        height: clamp(3rem, 14vw, 4.5rem);
    }
    
    .hero-title .title-aksara {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
        padding-bottom: 10px;
    }
    
    .countdown-item {
        min-width: 55px;
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .footer-links {
        gap: var(--spacing-sm);
    }
}

/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.text-gold { color: var(--color-gold); }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.hidden { display: none; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
