/* ========================
   Dynamic CSS
   Extracted from JavaScript to eliminate CSS injection
   Includes: theme transitions, animations, PWA banner, scroll progress
   ======================== */

/* ========================
   Theme Transitions (from theme.js)
======================== */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
    transition: background-color 300ms ease,
                color 300ms ease,
                border-color 300ms ease,
                box-shadow 300ms ease !important;
}

/* Theme toast notification */
.theme-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: var(--z-toast, 700);
    animation: slideInUp 0.3s ease;
}

.theme-toast.hiding {
    animation: slideOutDown 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* ========================
   Animation Classes (from animations.js)
======================== */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-in-up {
    animation: slideInUpAnim 0.6s ease forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.6s ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

.animate-scale {
    animation: zoomIn 0.6s ease forwards;
}

/* Reveal on scroll */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Split text animation */
.split-char {
    opacity: 0;
    animation: splitFadeIn 0.6s ease forwards;
}

@keyframes splitFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3D card and interactive element transitions */
[data-3d-card],
[data-magnetic],
[data-tilt] {
    transition: transform 0.3s ease;
}

/* Paused animation state */
.paused {
    animation-play-state: paused !important;
}

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

@keyframes slideInUpAnim {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================
   Scroll Progress Bar (from animations.js)
======================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-secondary);
    z-index: var(--z-pwa-banner, 600);
    transition: width 0.1s ease;
    width: 0;
}

/* ========================
   PWA Install Banner (from pwa-install.js)
======================== */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: linear-gradient(135deg, var(--surface, #1e293b) 0%, var(--surface-alt, #0f172a) 100%);
    border: 1px solid var(--border-color, #334155);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: var(--z-pwa-banner, 600);
    max-width: 420px;
    width: calc(100% - 40px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-banner.visible {
    transform: translateX(-50%) translateY(0);
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color, #4f46e5) 0%, var(--secondary-color, #7c3aed) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-install-icon i {
    font-size: 24px;
    color: white;
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-text strong {
    display: block;
    color: var(--text-primary, #f1f5f9);
    font-size: 16px;
    margin-bottom: 2px;
}

.pwa-install-text span {
    display: block;
    color: var(--text-muted, #94a3b8);
    font-size: 13px;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, var(--primary-color, #4f46e5) 0%, var(--secondary-color, #7c3aed) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-dismiss-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.pwa-dismiss-btn:hover {
    background: var(--border-color, #334155);
    color: var(--text-primary, #f1f5f9);
}

/* PWA Banner Responsive */
@media (max-width: 480px) {
    .pwa-install-banner {
        bottom: 10px;
        padding: 12px 16px;
    }

    .pwa-install-content {
        gap: 12px;
    }

    .pwa-install-icon {
        width: 40px;
        height: 40px;
    }

    .pwa-install-icon i {
        font-size: 20px;
    }

    .pwa-install-text strong {
        font-size: 14px;
    }

    .pwa-install-text span {
        font-size: 12px;
    }

    .pwa-install-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ========================
   Custom Cursor (from main.js)
======================== */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease;
    z-index: var(--z-toast, 700);
}

.custom-cursor.click {
    width: 15px;
    height: 15px;
}

/* ========================
   Navbar Hidden State (from main.js scroll behavior)
======================== */
.navbar.navbar-hidden {
    transform: translateY(-100%);
}
