/* ==========================================================================
   YouTube SEO AI Tool - Custom Design System & CSS Stylesheet
   Primary: #4F46E5 | Secondary: #2563EB | Accent: #06B6D4
   ========================================================================== */

:root {
    --primary-color: #4F46E5;
    --secondary-color: #2563EB;
    --accent-color: #06B6D4;
    --primary-gradient: linear-gradient(135deg, #4F46E5 0%, #2563EB 50%, #06B6D4 100%);
    --primary-gradient-hover: linear-gradient(135deg, #4338CA 0%, #1D4ED8 50%, #0891B2 100%);
    
    /* Light Theme Tokens */
    --bg-body: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-subtle: #F1F5F9;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --card-shadow: 0 10px 30px -5px rgba(79, 70, 229, 0.08);
    --card-shadow-hover: 0 20px 40px -10px rgba(79, 70, 229, 0.16);
    --input-bg: #FFFFFF;
}

[data-bs-theme="dark"] {
    /* Dark Theme Tokens */
    --bg-body: #0F172A;
    --bg-surface: #1E293B;
    --bg-surface-subtle: #334155;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 20px 40px -10px rgba(79, 70, 229, 0.25);
    --input-bg: #1E293B;
}

/* Global Reset & Base Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Gradient Utilities */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-surface {
    background-color: var(--bg-surface) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

/* Custom Glassmorphism & Sticky Navbar */
.custom-navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .custom-navbar {
    background: rgba(30, 41, 59, 0.85);
}

.nav-pills-custom .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 50rem;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

.nav-pills-custom .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-surface-subtle);
}

.nav-pills-custom .nav-link.active {
    background: var(--primary-gradient) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

/* Rounded Cards (20px) */
.card-custom {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px !important;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease;
}

.card-custom:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

/* Gradient Buttons */
.btn-primary-gradient {
    background: var(--primary-gradient);
    border: none;
    color: #ffffff;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary-gradient:hover, .btn-primary-gradient:focus {
    background: var(--primary-gradient-hover);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-icon-round {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-icon-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Hero Generator Bar */
.hero-input-group {
    background-color: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 50rem;
    padding: 6px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.hero-input-group .form-control {
    border: none;
    background: transparent;
    box-shadow: none;
    font-size: 1.1rem;
    padding-left: 1.5rem;
    color: var(--text-main);
}

/* SEO Score Gauge Meter */
.score-circle-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.score-circle-wrapper svg {
    transform: rotate(-90deg);
}

.score-circle-bg {
    fill: none;
    stroke: var(--bg-surface-subtle);
    stroke-width: 10;
}

.score-circle-val {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 377; /* 2 * PI * 60 */
    stroke-dashoffset: 377;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.165, 0.84, 0.44, 1), stroke 0.5s ease;
}

.score-text-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* Output Copy & Tag Pill Badges */
.tag-badge {
    background-color: var(--bg-surface-subtle);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 50rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.35rem;
    margin-bottom: 0.4rem;
    transition: all 0.2s ease;
}

.tag-badge:hover {
    background-color: rgba(79, 70, 229, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* AI Skeleton Loader Pulse */
.skeleton-box {
    background: linear-gradient(90deg, var(--bg-surface-subtle) 25%, var(--border-color) 50%, var(--bg-surface-subtle) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* AI Generating Loader Pulse Ring */
.ai-loader-ring {
    display: inline-block;
    width: 64px;
    height: 64px;
}
.ai-loader-ring:after {
    content: " ";
    display: block;
    width: 52px;
    height: 52px;
    margin: 6px;
    border-radius: 50%;
    border: 6px solid var(--accent-color);
    border-color: var(--accent-color) transparent var(--primary-color) transparent;
    animation: aiRing 1.2s linear infinite;
}
@keyframes aiRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* AdSense Safe Containers */
.ad-placeholder {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-style: dashed !important;
}

/* Micro Animations */
.animate-fade-in {
    animation: fadeIn 0.4s ease-in-out forwards;
}

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