/* ============================
   CSS Variables
   ============================ */
:root {
    --primary: #667eea;
    --primary-rgb: 102, 126, 234;
    --secondary: #764ba2;
    --accent: #00d4ff;
    --bg-dark: #0a0a0f;
}

/* ============================
   Base Styles
   ============================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ============================
   Animated Background
   ============================ */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0f0f1a 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    top: -200px;
    right: -200px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--secondary), #ff6b6b);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -50px) scale(1.05);
    }

    50% {
        transform: translate(-30px, 30px) scale(0.95);
    }

    75% {
        transform: translate(-50px, -30px) scale(1.02);
    }
}

/* ============================
   Logo
   ============================ */
.logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.4);
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================
   Glass Card
   ============================ */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(var(--primary-rgb), 0.3) !important;
}

/* ============================
   Form Controls Override
   ============================ */
.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    padding: 14px 18px;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
    color: #fff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ============================
   Theme Selection
   ============================ */
.theme-option {
    cursor: pointer;
}

.theme-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.theme-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.theme-card.selected {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.1);
}

.theme-preview {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.theme-preview::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.theme-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.theme-card.selected .theme-name {
    color: var(--accent);
}

/* ============================
   Custom Range Slider
   ============================ */
.form-range::-webkit-slider-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.5);
}

.form-range::-webkit-slider-track {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================
   Buttons
   ============================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.3);
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 12px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 6px 30px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.6;
}

.btn-primary .btn-loader {
    display: none;
}

.btn-primary.loading .btn-content {
    display: none;
}

.btn-primary.loading .btn-loader {
    display: inline-flex;
    align-items: center;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    font-weight: 600;
}

.btn-success:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    font-weight: 600;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.btn-group .btn {
    border-radius: 10px;
}

.btn-group .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-outline-light {
    border-radius: 10px;
}

.nav-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ============================
   Loading Section
   ============================ */
.loading-spinner {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loading-spinner .spinner-grow {
    animation-duration: 1.2s;
}

.loading-spinner .spinner-grow:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-spinner .spinner-grow:nth-child(3) {
    animation-delay: 0.3s;
}

/* ============================
   Slide Preview
   ============================ */
.slide-wrapper {
    display: none;
    animation: slideIn 0.4s ease;
}

.slide-wrapper.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

.slide-preview {
    aspect-ratio: 16 / 9;
    padding: 40px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.slide-number {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.layout-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.slide-header {
    margin-bottom: 16px;
}

.slide-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ============================
   Slide Layout Specific Styles
   ============================ */

/* Intro slide */
.intro-description {
    font-size: 1rem;
}

.key-point {
    transition: transform 0.2s ease;
}

.key-point:hover {
    transform: translateY(-2px);
}

/* Two Column */
.column-card {
    min-height: 200px;
}

/* Bullets */
.bullet-card {
    transition: all 0.2s ease;
}

.bullet-card:hover {
    transform: translateX(4px);
}

.bullet-number {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Stats */
.stat-card {
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: scale(1.02);
}

.stat-value {
    font-size: 2.5rem;
}

/* Timeline */
.timeline-container {
    padding-left: 10px;
}

.timeline-line {
    border-radius: 4px;
}

.timeline-item {
    transition: transform 0.2s ease;
}

.timeline-item:hover {
    transform: translateX(4px);
}

.timeline-dot {
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 0 15px currentColor;
}

/* Conclusion */
.takeaway-card {
    transition: transform 0.2s ease;
}

.takeaway-card:hover {
    transform: translateY(-2px);
}

.cta-box {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ============================
   Slide Indicators
   ============================ */
.slide-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.slide-indicator:hover {
    background: rgba(255, 255, 255, 0.4);
}

.slide-indicator.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transform: scale(1.3);
}

/* ============================
   Toast Customization
   ============================ */
.toast {
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 12px;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 768px) {
    .slide-preview {
        padding: 24px;
        aspect-ratio: 4 / 3;
    }

    .slide-preview h1,
    .slide-preview .display-4 {
        font-size: 1.5rem !important;
    }

    .slide-preview h2,
    .slide-preview .h1 {
        font-size: 1.25rem !important;
    }

    .slide-preview h3,
    .slide-preview h4 {
        font-size: 1rem !important;
    }

    .slide-preview p,
    .slide-preview li {
        font-size: 0.85rem !important;
    }

    .stat-value {
        font-size: 1.75rem !important;
    }

    .column-card {
        min-height: auto;
    }

    .layout-badge {
        display: none;
    }

    .preview-actions {
        width: 100%;
    }

    .btn-group {
        flex: 1;
    }

    .btn-group .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .slide-preview {
        padding: 16px;
    }

    .timeline-container {
        padding-left: 5px;
    }

    .timeline-dot {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.75rem;
    }
}