/**
 * ToolBox - Premium Brand Identity (WHITE + INDIGO + CORAL)
 *
 * Primary Brand Colors:
 * - WHITE (#FFFFFF): Clean space, main background, cards.
 * - INDIGO (#4F46E5): Technology, brand text, navigation, secondary actions, icons.
 * - CORAL (#FF6B6B): Energy, primary CTA buttons, active states, highlights.
 *
 * Includes Flash-Free Light/Dark Mode, Inter typography, Command Palette Hero Search,
 * High-Visibility Segmented Theme Toggle Switch [ ☀ Light | 🌙 Dark ], and Responsive SaaS Layout.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Default Light Theme Variables (WHITE + INDIGO + CORAL) */
:root {
    --bg-body: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-elevated: #FFFFFF;
    --bg-hover: #F8FAFC;
    --bg-active: #EEF2FF;
    
    --bg-indigo-soft: #EEF2FF;
    --bg-coral-soft: #FFF1F2;
    
    --border-color: #E5E7EB;
    --border-hover: #D1D5DB;
    --border-focus: #4F46E5;
    
    --text-primary: #111827;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    
    /* Brand Roles */
    --indigo-primary: #4F46E5;
    --indigo-hover: #4338CA;
    --coral-primary: #FF6B6B;
    --coral-hover: #F05252;
    
    --primary-color: #4F46E5;
    --secondary-color: #7C3AED;
    --cta-color: #FF6B6B;
    --cta-hover: #F05252;
    
    --brand-gradient: linear-gradient(135deg, #4F46E5 0%, #FF6B6B 100%);
    --indigo-gradient: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
    
    --success-color: #16A34A;
    --warning-color: #F59E0B;
    --error-color: #DC2626;
    
    --focus-ring: #4F46E5;
    --focus-glow: rgba(255, 107, 107, 0.2);
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.08), 0 8px 12px -4px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 14px 30px -6px rgba(79, 70, 229, 0.14);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-body: #111827;
    --bg-secondary: #172033;
    --bg-surface: #1F2937;
    --bg-card: #1F2937;
    --bg-card-elevated: #263449;
    --bg-hover: #2D3748;
    --bg-active: rgba(129, 140, 248, 0.15);
    
    --bg-indigo-soft: rgba(129, 140, 248, 0.12);
    --bg-coral-soft: rgba(255, 122, 122, 0.12);
    
    --border-color: #374151;
    --border-hover: #4B5563;
    --border-focus: #818CF8;
    
    --text-primary: #F9FAFB;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    
    --indigo-primary: #818CF8;
    --indigo-hover: #6366F1;
    --coral-primary: #FF7A7A;
    --coral-hover: #FF6B6B;
    
    --primary-color: #818CF8;
    --cta-color: #FF7A7A;
    --cta-hover: #FF6B6B;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 14px 30px -6px rgba(129, 140, 248, 0.22);
}

/* Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-main {
    flex: 1;
}

/* Header & Sticky Navigation */
.app-header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .app-header {
    background-color: rgba(31, 41, 55, 0.9);
}

.header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Brand Logo (ILY ❤️ Tools: ILY in Indigo, Heart in Coral, Tools in Indigo) */
.brand-logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    white-space: nowrap;
    text-decoration: none;
}

.brand-logo .logo-text-ily,
.brand-logo .logo-text-tools {
    color: var(--indigo-primary);
}

.brand-logo .logo-heart {
    color: var(--coral-primary);
    font-size: 1.15rem;
    display: inline-block;
    transition: transform 0.2s ease;
}

.brand-logo:hover .logo-heart {
    transform: scale(1.18);
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.15s ease;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--indigo-primary);
}

.nav-right-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* High-Visibility Segmented Theme Toggle Switch [ ☀ Light | 🌙 Dark ] */
.theme-toggle-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 3px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    outline: none;
}

.theme-toggle-btn:focus-visible {
    border-color: var(--indigo-primary);
    box-shadow: 0 0 0 3px var(--focus-glow);
}

.theme-option {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.theme-option.active {
    background-color: var(--indigo-primary);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.theme-option .icon {
    font-size: 0.85rem;
}

/* Hero Section */
.hero-section {
    padding: 4.5rem 0 3.5rem;
    text-align: center;
    position: relative;
    background: radial-gradient(circle at 50% 0%, rgba(238, 242, 255, 0.6) 0%, rgba(255, 255, 255, 0) 70%);
}

[data-theme="dark"] .hero-section {
    background: radial-gradient(circle at 50% 0%, rgba(129, 140, 248, 0.08) 0%, rgba(17, 24, 39, 0) 70%);
}

.hero-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.hero-badge-pill .check-icon {
    color: var(--coral-primary);
    font-weight: 800;
}

.hero-title {
    font-size: 3.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: 1.15rem;
    line-height: 1.1;
}

/* Indigo → Coral Gradient Text */
.hero-gradient-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 660px;
    margin: 0 auto 2.25rem;
    line-height: 1.6;
}

/* Command Palette Hero Search */
.hero-search-container {
    position: relative;
    max-width: 640px;
    margin: 0 auto 1.75rem;
}

.hero-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    height: 66px;
    padding: 0 1.35rem;
    box-shadow: var(--shadow-md);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-search-box:focus-within {
    border-color: var(--indigo-primary);
    box-shadow: 0 0 0 4px var(--focus-glow), var(--shadow-lg);
}

.search-box-icon {
    color: var(--text-muted);
    margin-right: 0.85rem;
    display: flex;
    align-items: center;
}

.hero-search-input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
}

.hero-search-input::placeholder {
    color: var(--text-muted);
}

.search-shortcut-badge {
    padding: 0.25rem 0.6rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
}

/* Search Dropdown Panel */
.search-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    display: none;
    text-align: left;
    max-height: 380px;
    overflow-y: auto;
}

.search-dropdown-header {
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--bg-hover);
}

.search-result-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background-color: var(--bg-indigo-soft);
    color: var(--indigo-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.search-result-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Shortcut Pills Below Search */
.hero-shortcuts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    max-width: 840px;
    margin: 0 auto 2.5rem;
}

.shortcut-pill {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.shortcut-pill:nth-child(even):hover {
    color: var(--coral-primary);
    border-color: var(--coral-primary);
    background-color: var(--bg-coral-soft);
    transform: translateY(-1px);
}

.shortcut-pill:nth-child(odd):hover {
    color: var(--indigo-primary);
    border-color: var(--indigo-primary);
    background-color: var(--bg-indigo-soft);
    transform: translateY(-1px);
}

/* Trust Indicators Bar */
.trust-indicators-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1.15rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3.5rem;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.trust-item .check {
    color: var(--coral-primary);
    font-weight: 800;
}

/* Section Header */
.category-block {
    margin-bottom: 3.5rem;
}

.category-header {
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.category-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

/* Tool Cards (18–22px Radius) */
.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.tool-card:hover {
    border-color: var(--indigo-primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.tool-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: var(--bg-indigo-soft);
    border: 1px solid rgba(79, 70, 229, 0.15);
    color: var(--indigo-primary);
    flex-shrink: 0;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.06);
    background-color: var(--bg-coral-soft);
    color: var(--coral-primary);
    border-color: rgba(255, 107, 107, 0.2);
}

.tool-card-icon svg {
    width: 24px;
    height: 24px;
}

.tool-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tool-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.tool-card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.85rem;
}

.tool-card-action {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--indigo-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.15s ease, color 0.15s ease;
}

.tool-card:hover .tool-card-action {
    gap: 0.45rem;
    color: var(--coral-primary);
}

/* Featured Social Creator Section (Soft Coral + Soft Indigo Accent) */
.social-section-featured {
    background: linear-gradient(135deg, var(--bg-coral-soft) 0%, var(--bg-indigo-soft) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem 1.75rem;
    margin-bottom: 3.5rem;
    box-shadow: var(--shadow-sm);
}

/* Explore Toolbox Categories Grid */
.categories-explorer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.category-explorer-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.category-explorer-card:hover {
    border-color: var(--coral-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.category-explorer-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.category-explorer-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.category-explorer-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* How It Works Section (Coral → Indigo 3-Step Visual Progression) */
.how-it-works-section {
    padding: 4.5rem 0;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.section-header-center {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.step-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.step-number-coral {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--coral-primary);
    margin-bottom: 0.75rem;
}

.step-number-indigo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--indigo-primary);
    margin-bottom: 0.75rem;
}

.step-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.step-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Feature Banner Section (Indigo Background with Coral Accent) */
.feature-banner-section {
    padding: 3.5rem 0;
    text-align: center;
}

.feature-banner-card {
    background: var(--indigo-gradient);
    color: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 3.25rem 1.75rem;
    max-width: 820px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.feature-banner-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.65rem;
}

.feature-banner-title .accent-coral {
    color: #FFD1D1;
}

.feature-banner-desc {
    font-size: 1.05rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Footer */
.app-footer {
    padding: 3.5rem 0 2rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface);
}

.footer-columns {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.footer-col-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-col-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-col-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.footer-col-links a:hover {
    color: var(--indigo-primary);
}

.footer-bottom {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 1.75rem;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--coral-primary);
    color: var(--text-primary);
    padding: 0.85rem 1.35rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Responsive Grid Adjustments & Mobile Header Protection */
@media (max-width: 1024px) {
    .hero-title { font-size: 3rem; }
    .tools-grid, .categories-explorer-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-columns { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .main-nav {
        display: none; /* Hide navigation links on smaller screens to guarantee theme toggle is 100% visible */
    }
}

@media (max-width: 640px) {
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1rem; }
    .tools-grid, .categories-explorer-grid, .steps-grid, .footer-columns { grid-template-columns: 1fr; }
    .hero-search-box { height: 58px; }
    .search-shortcut-badge { display: none; }
    .theme-option .label { display: none; } /* On tiny mobile screens show compact icons [ ☀ | 🌙 ] */
    .theme-option { padding: 4px 8px; }
}
