/* ============================================
   FoldedSkies - Component Styles
   ============================================ */

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

.nav {
    position: fixed;
    top: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-nav);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--glass-tint);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-button);
    box-shadow: var(--shadow-float);
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--text);
}

.nav__logo-icon {
    font-size: var(--text-xl);
}

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    position: relative;
}

.nav__link {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-button);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.nav__link:hover,
.nav__link--active {
    color: var(--text);
    background: var(--card);
}

.nav__cta {
    margin-left: var(--space-2);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-button);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn--primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn--primary:active {
    transform: translateY(0) scale(0.98);
}

.btn--secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn--ghost:hover {
    background: var(--glass-tint);
    color: var(--text);
}

.btn--large {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

/* Solar Flare Button - Breathing Animation */
.btn--solar {
    animation: solarFlare 4s ease-in-out infinite;
}

/* ============================================
   FLOATING ISLAND CARDS
   ============================================ */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-float);
    padding: var(--space-6);
    transition: transform var(--transition-float), box-shadow var(--transition-float);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-float-hover);
}

.card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.card__title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
    color: var(--text);
}

.card__description {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Message Card - Paper Plane Style */
.card--message {
    position: relative;
    padding: var(--space-8);
    background: linear-gradient(145deg, var(--card), var(--card-hover));
}

.card--message::before {
    content: '';
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, transparent 50%, var(--primary-glow) 50%);
    border-radius: 0 var(--radius-sm) 0 0;
    opacity: 0.5;
}

/* ============================================
   FROSTED GLASS LAYER
   ============================================ */

.glass {
    background: var(--glass-tint);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
}

.glass--light {
    background: rgba(255, 255, 255, 0.7);
}

.glass--dark {
    background: rgba(0, 0, 0, 0.3);
}

/* ============================================
   SECTION CONTAINERS
   ============================================ */

.section {
    padding: var(--space-24) 0;
    position: relative;
}

.section--hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-20) var(--space-6);
    overflow: hidden;
}

.section__header {
    max-width: 800px;
    margin: 0 auto var(--space-16);
    text-align: center;
}

.section__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary);
    background: var(--glass-tint);
    border-radius: var(--radius-button);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section__title {
    font-size: var(--text-5xl);
    margin-bottom: var(--space-4);
}

.section__subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid {
    display: grid;
    gap: var(--space-6);
}

.grid--features {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

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

/* ============================================
   THEME SWITCHER
   ============================================ */

.theme-switcher {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-modal);
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--glass-tint);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-button);
    box-shadow: var(--shadow-float);
}

.theme-switcher__btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.theme-switcher__btn:hover {
    transform: scale(1.1);
}

.theme-switcher__btn--active {
    border-color: var(--text);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Theme button colors */
.theme-switcher__btn[data-theme="pearl"] {
    background: linear-gradient(135deg, #f8f9fa, #0ea5e9);
}

.theme-switcher__btn[data-theme="amber"] {
    background: linear-gradient(135deg, #fffbeb, #f59e0b);
}

.theme-switcher__btn[data-theme="rose"] {
    background: linear-gradient(135deg, #fff1f2, #f43f5e);
}

.theme-switcher__btn[data-theme="ocean"] {
    background: linear-gradient(135deg, #f0f9ff, #0ea5e9);
}

.theme-switcher__btn[data-theme="obsidian"] {
    background: linear-gradient(135deg, #1a1b1e, #a855f7);
}

.theme-switcher__btn[data-theme="midnight"] {
    background: linear-gradient(135deg, #1a1e2d, #2563eb);
}

.theme-switcher__btn[data-theme="ruby"] {
    background: linear-gradient(135deg, #2d1a1a, #ef4444);
}

.theme-switcher__btn[data-theme="emerald"] {
    background: linear-gradient(135deg, #1a2d1e, #10b981);
}

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

.footer {
    padding: var(--space-12) 0;
    text-align: center;
    background: var(--glass-tint);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border);
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin-bottom: var(--space-6);
}

.footer__link {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer__link:hover {
    color: var(--primary);
}

.footer__social {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.footer__social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--text-secondary);
    background: var(--card);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.footer__social-link:hover {
    color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.footer__copyright {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    :root {
        --text-hero: clamp(2rem, 10vw, 3.5rem);
    }

    .nav {
        top: var(--space-4);
        padding: var(--space-1) var(--space-2);
    }

    .nav__links {
        display: none;
    }

    .section {
        padding: var(--space-16) 0;
    }

    .section__title {
        font-size: var(--text-3xl);
    }

    .container {
        padding: 0 var(--space-4);
    }

    .theme-switcher {
        bottom: var(--space-4);
        right: var(--space-4);
        flex-wrap: wrap;
    }
}

/* ============================================
   AUTH CONFIRMATION POPUP
   ============================================ */

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: fadeIn 0.3s ease;
}

.auth-modal {
    position: relative;
    max-width: 500px;
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-modal);
    padding: var(--space-10);
    box-shadow: var(--shadow-float-hover);
    text-align: center;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-modal__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-modal__close:hover {
    background: var(--glass-tint);
    color: var(--text);
    transform: rotate(90deg);
}

.auth-modal__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: 50%;
    color: white;
    box-shadow: 0 8px 20px var(--primary-glow);
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.auth-modal__icon svg {
    stroke-width: 2.5;
}

.auth-modal__title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    margin-bottom: var(--space-4);
    color: var(--text);
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
}

.auth-modal__message {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s backwards;
}

.auth-modal__button {
    width: 100%;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.5s backwards;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-modal {
        padding: var(--space-8);
    }

    .auth-modal__title {
        font-size: var(--text-2xl);
    }

    .auth-modal__icon {
        width: 64px;
        height: 64px;
    }
}