/**
 * ASMR Tools - Dark Modern UI Stylesheet
 * Mamuangsook.com
 */

/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-hover: #252535;
    --bg-prompt: #0d0d12;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --text-code: #c4b5fd;
    
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.3);
    
    --gradient-start: #8b5cf6;
    --gradient-end: #ec4899;
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Layout & Container
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: scale(1.02);
}

.logo-image {
    
    width: 200px;
    object-fit: contain;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: var(--radius-full);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: calc(70px + var(--space-2xl)) var(--space-md) var(--space-2xl);
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(139, 92, 246, 0.15) 0%, transparent 60%);
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.generate-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 60px var(--accent-glow);
}

.generate-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.4rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ============================================
   Main Content
   ============================================ */
.main {
    padding: var(--space-xl) 0 var(--space-2xl);
}

/* ============================================
   Prompt Section
   ============================================ */
.prompt-section {
    margin-bottom: var(--space-2xl);
}

/* Loading Animation */
.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
}

.loading-dots {
    display: flex;
    gap: var(--space-xs);
}

.dot {
    width: 12px;
    height: 12px;
    background: var(--gradient-start);
    border-radius: 50%;
    animation: pulse 1.4s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
.dot:nth-child(3) { animation-delay: 0s; }

@keyframes pulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hidden {
    display: none !important;
}

/* Prompt Card */
.prompt-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.card-header-left {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.category-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-secondary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.idea-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.viral-score {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-hover);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
}

.stars {
    color: #fbbf24;
    font-size: 1.1rem;
}

.score-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.idea-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.idea-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.detail-icon {
    font-size: 1.2rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   AI Prompt Box
   ============================================ */
.prompt-box {
    background: var(--bg-prompt);
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.3);
    overflow: hidden;
}

.prompt-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.prompt-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.label-icon {
    font-size: 1rem;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-primary);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: var(--success);
}

.copy-icon {
    font-size: 1rem;
}

.prompt-content-wrapper {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-prompt);
}

.prompt-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.prompt-content-wrapper::-webkit-scrollbar-track {
    background: var(--bg-prompt);
}

.prompt-content-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: var(--radius-full);
}

.prompt-content {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-code);
    padding: var(--space-md);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* Copy Notification */
.copy-notification {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    margin-top: var(--space-md);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    color: var(--success);
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-icon {
    font-size: 1.2rem;
}

/* Placeholder State */
.placeholder-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.placeholder-text {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

.placeholder-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: var(--space-lg) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .nav-links {
        gap: var(--space-md);
    }
    
    .hero {
        padding: calc(70px + var(--space-xl)) var(--space-md) var(--space-xl);
    }
    
    .generate-btn {
        padding: var(--space-sm) var(--space-lg);
        font-size: 1rem;
    }
    
    .prompt-card {
        padding: var(--space-md);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .idea-title {
        font-size: 1.25rem;
    }
    
    .idea-details {
        grid-template-columns: 1fr;
    }
    
    .prompt-box-header {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }
    
    .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-links a {
        font-size: 0.85rem;
    }

    .prompt-label {
        font-size: 0.75rem;
    }

    .prompt-content {
        font-size: 0.8rem;
    }

    .tiktok-card-inner {
        padding: var(--space-md);
    }

    .tiktok-avatar {
        width: 60px;
        height: 60px;
    }

    .tiktok-username {
        font-size: 1.1rem;
    }

    .tiktok-logo-large {
        width: 48px;
        height: 48px;
    }

    .tiktok-cta-button {
        font-size: 1rem;
        padding: var(--space-sm) var(--space-md);
    }
}

/* ============================================
   TikTok Creator Section
   ============================================ */
.tiktok-creator-section {
    padding: var(--space-xl) 0 var(--space-2xl);
    text-align: center;
}

.tiktok-section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tiktok-creator-card {
    display: inline-block;
    text-decoration: none;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.tiktok-card-inner {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-md), 0 0 30px rgba(139, 92, 246, 0.15);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tiktok-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00f2ea, #ff0050);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.tiktok-creator-card:hover .tiktok-card-inner {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.3);
}

.tiktok-creator-card:hover .tiktok-card-inner::before {
    opacity: 1;
}

.tiktok-profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tiktok-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.tiktok-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    transition: transform var(--transition-base);
}

.tiktok-creator-card:hover .tiktok-avatar {
    transform: scale(1.05);
}

.tiktok-verified-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: linear-gradient(135deg, #00f2ea, #ff0050);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tiktok-profile-info {
    text-align: left;
    flex: 1;
}

.tiktok-username {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tiktok-creator-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.tiktok-content-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.tiktok-logo-large {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 242, 234, 0.2), rgba(255, 0, 80, 0.2));
    border-radius: 50%;
    color: white;
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 242, 234, 0.3), 0 0 40px rgba(255, 0, 80, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 242, 234, 0.5), 0 0 60px rgba(255, 0, 80, 0.3);
        transform: scale(1.05);
    }
}

.tiktok-preview-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.tiktok-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, #00f2ea, #ff0050);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 20px rgba(255, 0, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tiktok-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 0, 80, 0.5);
    filter: brightness(1.1);
}

.tiktok-cta-button:active {
    transform: translateY(0);
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

a {
  text-decoration: none;
  color: var(--dark-color);
  transition: var(--transition);
}
