/**
 * Shopee Affiliate Content Generator - Style
 * Premium "Hiso" Design | Clean, Modern, Luxurious
 */

/* ============================================
   Variables
   ============================================ */
:root {
    /* Brand Colors */
    --primary: #ee4d2d;
    --primary-dark: #d73211;
    --primary-glow: rgba(238, 77, 45, 0.4);
    --accent: #00cec9;
    --accent-glow: rgba(0, 206, 201, 0.4);
    --gold: #ffd700;
    --purple: #6c5ce7;

    /* Backgrounds */
    --bg-dark: #0a0a1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    /* Increased opacity for better visibility */
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.1);
    --glass-heavy: rgba(20, 20, 35, 0.85);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* UI Elements */
    --border: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(238, 77, 45, 0.3);

    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Effects */
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px var(--primary-glow);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Animations & Transitions
   ============================================ */
@keyframes auto-selected-blink {
    0% {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(238, 77, 45, 0.2);
        transform: scale(1.02);
    }

    50% {
        border-color: var(--gold);
        box-shadow: 0 0 0 8px rgba(255, 215, 0, 0.1);
        transform: scale(1.05);
    }

    100% {
        border-color: var(--primary);
        box-shadow: 0 0 0 0 rgba(238, 77, 45, 0);
        transform: scale(1);
    }
}

.auto-selected-blink {
    animation: auto-selected-blink 0.8s ease-in-out 2;
    z-index: 10;
}

/* Edit Mode Badge */
.edit-mode-badge {
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Prompt', 'Inter', sans-serif;
    background: var(--bg-dark);
    /* Premium dark gradient background */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(108, 92, 231, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(238, 77, 45, 0.15) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Particles Animation
   ============================================ */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10%,
    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   Layout
   ============================================ */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header
   ============================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(238, 77, 45, 0.5));
    animation: bounce 3s infinite ease-in-out;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.logo-text .highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 50%, #ff6b4a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   Quick Steps
   ============================================ */
.quick-steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.step-num {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 10px rgba(238, 77, 45, 0.3);
}

/* ============================================
   Glass Card
   ============================================ */
.glass-card {
    background: var(--glass-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Form
   ============================================ */
.product-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    margin-bottom: 10px;
}

.section-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.flex-1 {
    flex: 1;
}

.form-group.flex-2 {
    flex: 2;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group label .hint {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(238, 77, 45, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select option {
    background: #1a1a2e;
    color: white;
}

/* ============================================
   Media Upload
   ============================================ */
.media-upload-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    min-height: 140px;
}

.upload-box:hover,
.upload-box.drag-over {
    border-color: var(--primary);
    background: rgba(238, 77, 45, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    transition: var(--transition);
}

.upload-box:hover .upload-icon {
    transform: scale(1.1);
}

.upload-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.media-preview-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.media-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.media-item:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    cursor: grab;
}

.media-item:active {
    cursor: grabbing;
}

.media-item.dragging {
    opacity: 0.4;
    border: 2px dashed var(--primary);
    transform: scale(0.95);
}

.media-item.drag-over {
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold);
    transform: scale(1.08);
}

.media-item.is-video {
    border-color: var(--accent);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.media-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(231, 76, 60, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-item:hover .remove-btn {
    opacity: 1;
}

.media-counter {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: right;
}

/* ============================================
   Hashtags
   ============================================ */
.hashtag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.hashtag-chip {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.hashtag-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(238, 77, 45, 0.1);
}

.hashtag-chip.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(238, 77, 45, 0.3);
}

/* ============================================
   AI Settings
   ============================================ */
.ai-settings {
    background: rgba(108, 92, 231, 0.05);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.ai-settings:hover {
    border-color: rgba(108, 92, 231, 0.4);
}

.ai-settings summary {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.ai-settings[open] summary {
    margin-bottom: 16px;
}

/* ============================================
   Buttons
   ============================================ */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-top: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(238, 77, 45, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(238, 77, 45, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-primary);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    transform: scale(1.1) rotate(10deg);
    border-color: var(--primary);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.15rem;
}

/* ============================================
   Result Section
   ============================================ */
.result-card {
    border: 1px solid var(--primary-glow);
    box-shadow: 0 0 40px rgba(238, 77, 45, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.result-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-actions-top {
    display: flex;
    gap: 10px;
}

.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-content {
    display: none;
}

.result-text {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 24px;
    font-size: 1rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border);
    font-family: 'Prompt', monospace;
    /* Keep Prompt for readability */
}

/* Result Tabs */
.result-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2px;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Video Preview Player */
.video-preview-player {
    position: relative;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 9/16;
    margin: 0 auto 24px;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 3px solid var(--border);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.preview-stage {
    width: 100%;
    height: 100%;
    position: relative;
}

.preview-stage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 3s ease-in-out;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
}

.preview-headline {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 4px 0 var(--primary), 0 8px 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    line-height: 1.2;
    animation: textJump 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.preview-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    background: var(--primary);
    padding: 8px 16px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.preview-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 6px;
    background: var(--gold);
    width: 0%;
    transition: width linear;
}

.close-preview {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

@keyframes textJump {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.scene-card::before {
    content: attr(data-scene);
    position: absolute;
    top: -5px;
    right: 5px;
    font-size: 3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.scene-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.scene-number {
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.scene-headline {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    display: block;
    margin-bottom: 6px;
    line-height: 1.4;
}

.scene-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: block;
    line-height: 1.5;
    padding-left: 5px;
    border-left: 3px solid var(--accent);
}

/* Custom scroll for result text */
.result-text::-webkit-scrollbar,
.video-script-scenes::-webkit-scrollbar {
    width: 6px;
}

.result-text::-webkit-scrollbar-thumb,
.video-script-scenes::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.result-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.result-actions .btn {
    flex: 1;
}

/* ============================================
   Wheeler Info
   ============================================ */
.wheeler-info {
    padding: 16px;
}

.wheeler-info summary {
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.wheeler-info summary:hover {
    color: var(--primary);
}

.wheeler-info ul {
    margin-top: 16px;
    padding-left: 20px;
}

.wheeler-info li {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.wheeler-info strong {
    color: var(--gold);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 30px;
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer strong {
    color: var(--text-secondary);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1a1a2e;
    border-radius: var(--radius-lg);
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

.sales-modal {
    padding: 0;
    overflow: hidden;
}

.sales-gallery {
    position: relative;
    background: black;
}

.gallery-main-container {
    aspect-ratio: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main-container img,
.gallery-main-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.5);
}

.thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.thumb.active,
.thumb:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.sales-info {
    padding: 24px;
}

.sales-info h1 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    line-height: 1.4;
    font-weight: 600;
}

.sales-price {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.current-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.original-price {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.discount-badge {
    background: rgba(238, 77, 45, 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
}

.sales-description {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 16px 30px;
    border-radius: 50px;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
    /* Assuming success var exists or use green */
    border-color: #00b894;
}

.toast.success::before {
    content: '✅';
}

.toast.error {
    border-color: #ff7675;
}

.toast.error::before {
    content: '❌';
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {

    /* Mobile Performance Logic: Reduce glass effect */
    .glass-card,
    .header,
    .nav-btn,
    .search-box input,
    .quick-steps,
    .modal-overlay {
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        box-shadow: none !important;
        /* Remove heavy shadows */
        background: rgba(20, 20, 35, 0.95) !important;
        /* Use more opaque bg instead */
    }

    /* Reduce particle cost */
    .particle {
        will-change: transform, opacity;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: 16px;
    }

    .quick-steps {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .step {
        width: 100%;
    }

    .media-upload-row {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Sales Modal Mobile Optimization */
    .modal-overlay {
        padding: 0;
    }

    .modal-content {
        max-height: 100vh;
        border-radius: 0;
        height: 100%;
    }

    .sales-modal {
        border-radius: 0;
    }

    .sales-info {
        padding: 20px 16px 100px;
        /* Extra bottom padding for floating button if needed */
    }

    .sales-info h1 {
        font-size: 1.15rem;
    }

    .current-price {
        font-size: 1.5rem;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
    }
}

/* ============================================
   Premium Custom Modal
   ============================================ */
#customModalOverlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 9999 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

#customModalOverlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: rgba(30, 30, 45, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border-radius: 30px;
    width: 90%;
    max-width: 420px;
    padding: 40px 30px;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
}

/* Shine effect */
.custom-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: skewX(-15deg);
    transition: 0.5s;
}

#customModalOverlay.active .custom-modal {
    transform: scale(1) translateY(0);
}

#customModalOverlay.active .custom-modal::before {
    left: 100%;
    transition: 1s ease-in-out;
}

.modal-icon {
    font-size: 4.5rem;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 30px rgba(0, 206, 201, 0.4));
    animation: icon-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes icon-pop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.custom-modal .modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, #a29bfe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.custom-modal .modal-text {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 32px;
    line-height: 1.6;
}

.modal-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-width: 120px;
    position: relative;
    z-index: 2;
}

.btn-confirm {
    background: linear-gradient(135deg, #00cec9 0%, #00b894 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 184, 148, 0.3);
}

.btn-confirm:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 184, 148, 0.5);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   AI Video Ad Preview (Premium Slideshow)
   ============================================ */
.video-ad-section {
    margin-top: 30px;
    border: 1px solid var(--accent-glow);
    padding: 24px;
    background: rgba(0, 206, 201, 0.03);
    border-radius: var(--radius-lg);
    display: none;
    /* Hidden by default */
}

.video-ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.video-ad-header h3 {
    font-size: 1.1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-preview-container {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-width: 320px;
    margin: 30px auto;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    border: 6px solid #1a1a2e;
}

#videoSlides {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.video-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-slide.active {
    opacity: 1;
}

.video-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: zoomInOut 10s infinite alternate ease-in-out;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.9) 100%);
    pointer-events: none;
    z-index: 5;
}

.video-text-content {
    position: absolute;
    bottom: 80px;
    left: 24px;
    right: 24px;
    z-index: 10;
}

.v-headline {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.9);
    margin-bottom: 12px;
    line-height: 1.25;
    transform: translateY(30px);
    opacity: 0;
}

.v-subtitle {
    font-size: 0.95rem;
    color: var(--gold);
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    transform: translateY(20px);
    opacity: 0;
}

.video-slide.active .v-headline {
    animation: textAppear 0.8s 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-slide.active .v-subtitle {
    animation: textAppear 0.8s 0.5s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.v-brand-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 6px 15px rgba(238, 77, 45, 0.4);
    z-index: 10;
}

.v-cta-button {
    position: absolute;
    bottom: 30px;
    left: 24px;
    right: 24px;
    background: #fff;
    color: #000;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 10;
    letter-spacing: 1px;
}

@keyframes zoomInOut {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.2);
    }
}

@keyframes textAppear {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.video-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
}

/* --- 8-Scene Storyboard Enhancements --- */
.video-script-scenes {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.scene-card {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.scene-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.scene-rule-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 0.5px;
}

.scene-tech-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tech-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tech-item i {
    color: var(--accent);
    margin-right: 6px;
}

/* Voice Playing Animation */
.btn.is-playing {
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
    box-shadow: 0 0 20px rgba(214, 48, 49, 0.6);
    animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.tab-btn {
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    padding: 10px 15px;
    opacity: 0.6;
}

.tab-btn.active {
    opacity: 1;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

.tab-btn:hover {
    opacity: 1;
    color: var(--primary);
}

/* Agency Mode Styles */
.agency-status-badge {
    display: inline-block;
    padding: 5px 15px;
    background: linear-gradient(135deg, var(--purple), var(--accent));
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.scene-card {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.scene-card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-5px);
    border-color: var(--primary-glow);
}