/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Colors - Deep Premium Dark Theme */
    --bg-main: #040508; /* Ultra-deep dark background */
    --bg-card: rgba(13, 14, 22, 0.7);
    --bg-card-hover: rgba(22, 24, 38, 0.9);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-active: rgba(255, 51, 102, 0.2);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Brand Accent & Gradients - Replicating Neon Pink/Purple/Orange Glow */
    --accent: #d946ef; /* Vibrant Neon Magenta */
    --accent-hover: #ff3366; /* Vibrant Pink/Coral */
    --accent-glow: rgba(217, 70, 239, 0.25);
    --gradient-accent: linear-gradient(135deg, #ff9933 0%, #ff3366 50%, #7f00ff 100%);
    --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
    
    /* Category Colors (Tailored HSL values) */
    --color-educational: hsl(225, 75%, 55%);
    --color-comparison: hsl(150, 70%, 45%);
    --color-mythbusting: hsl(15, 85%, 55%);
    --color-storytelling: hsl(270, 75%, 60%);
    --color-random: hsl(330, 80%, 60%);
    --color-authority: hsl(40, 95%, 50%);
    --color-dayinthelife: hsl(190, 80%, 45%);
    
    /* UI Sizing */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Glassmorphism Blur */
    --glass-blur: 24px;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(217, 70, 239, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(255, 51, 102, 0.05) 0%, transparent 45%);
    background-attachment: fixed;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   APP LAYOUT (Sidebar + Main Grid)
   ========================================================================== */
.app-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    min-height: 100vh;
}

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   HEADER / SIDEBAR SIDE (Static Left)
   ========================================================================== */
.app-header {
    background-color: rgba(10, 11, 16, 0.8);
    border-right: 1px solid var(--border-color);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    backdrop-filter: blur(var(--glass-blur));
}

@media (max-width: 1024px) {
    .app-header {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 30px 20px;
    }
}

/* Logo Styling - 3D Rounded Square Hook Logo */
.logo-container {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(217, 70, 239, 0.2);
    border: 1.5px solid rgba(255, 51, 102, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background-color: #0d0e16;
    transition: var(--transition-smooth);
}

.logo-container:hover {
    transform: scale(1.03) rotate(1deg);
    box-shadow: 0 12px 32px rgba(217, 70, 239, 0.35);
    border-color: rgba(255, 51, 102, 0.5);
}

.app-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .logo-container {
        margin: 0 auto 10px auto;
    }
}

.app-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.15;
    background: linear-gradient(135deg, #ff9933 0%, #ff3366 50%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.6;
}

/* Stats Card Panel */
.stats-card {
    background: var(--gradient-card);
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stats-header {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.category-stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.cat-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.cat-stat-name {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.cat-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   MAIN CONTENT SIDE (Right)
   ========================================================================== */
.main-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1024px) {
    .main-content {
        padding: 20px;
    }
}

/* ==========================================================================
   CONTROLS BAR (Search & Categories Scroll)
   ========================================================================== */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Search Box glass */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 20px;
    height: 60px;
    transition: var(--transition-smooth);
}

.search-box:focus-within {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color-active);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    margin-right: 15px;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.search-box:focus-within .search-icon {
    color: var(--accent);
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    width: 100%;
    height: 100%;
}

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

.clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
}

.clear-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.clear-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.clear-btn svg {
    width: 18px;
    height: 18px;
}

/* Category Filters Horizontal Scroll */
.category-filters-container {
    position: relative;
    width: 100%;
}

.category-filters-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 10px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for layout cleanliness */
.category-filters-scroll::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 10px 18px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-color-active);
}

.filter-tab.active {
    background-color: var(--text-primary);
    color: var(--bg-main);
    border-color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.tab-count {
    font-size: 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: inherit;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.filter-tab.active .tab-count {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Active filter clear indicator */
.active-filters-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 0.9rem;
}

.reset-filter-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
}

.reset-filter-btn:hover {
    color: #4ade80;
}

/* ==========================================================================
   HOOKS GRID & CARDS
   ========================================================================== */
.hooks-grid-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.hooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

@media (max-width: 480px) {
    .hooks-grid {
        grid-template-columns: 1fr;
    }
}

/* The Card Structure (Glassmorphism & animations) */
.hook-card {
    background: var(--gradient-card);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.hook-card:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-color-active);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

/* Accent Card Glow on Category Color */
.hook-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--cat-color, var(--accent));
    opacity: 0.8;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hook-id {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: monospace;
    background-color: rgba(255, 255, 255, 0.03);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.category-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cat-color, var(--accent));
    background-color: rgba(var(--cat-color-rgb, 34, 197, 94), 0.08);
    border: 1px solid rgba(var(--cat-color-rgb, 34, 197, 94), 0.25);
    padding: 4px 10px;
    border-radius: 50px;
}

/* Card Content Area */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.hook-portuguese {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
}

/* Placeholders inside the translated hook (Highlighted styled terms) */
.hook-portuguese mark,
.hook-english mark {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px dashed rgba(34, 197, 94, 0.35);
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 500;
}

.hook-english {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
    border-left: 2px solid var(--border-color);
    padding-left: 10px;
    word-break: break-word;
}

/* Card Footer - Buttons */
.card-footer {
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: auto;
}

/* Copy Button styles */
.copy-btn {
    flex-grow: 1;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    height: 42px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-color-active);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

.copy-btn.copied {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--accent);
    border-color: rgba(34, 197, 94, 0.3);
}

/* Example Video Button Link */
.example-btn {
    width: 42px;
    height: 42px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    flex-shrink: 0;
}

.example-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-color-active);
    transform: scale(1.05);
}

.example-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   LOADING & STATE ANIMATIONS
   ========================================================================== */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No Results State */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    gap: 15px;
}

.no-results-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
}

.no-results h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.no-results p {
    color: var(--text-muted);
    max-width: 400px;
    font-size: 0.95rem;
}

.reset-btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    transition: var(--transition-fast);
}

.reset-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-active);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #121318;
    border: 1px solid var(--border-color-active);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}

/* ==========================================================================
   TABLET RESPONSIVENESS ADJUSTMENTS (768px a 1024px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .app-header {
        display: grid;
        grid-template-columns: 1fr 340px;
        align-items: center;
        gap: 30px;
        height: auto;
        padding: 30px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
    }
    
    .logo-container {
        margin: 0 0 10px 0;
    }
    
    .stats-card {
        margin-top: 0;
        width: 100%;
    }
    
    .main-content {
        padding: 30px;
    }
    
    .hooks-grid {
        grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
        gap: 20px;
    }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS ADJUSTMENTS (Celulares < 768px)
   ========================================================================== */
@media (max-width: 767px) {
    /* Main Layout */
    .app-container {
        grid-template-columns: 1fr;
    }

    /* Header on Mobile */
    .app-header {
        padding: 24px 16px;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        gap: 15px;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .app-title {
        font-size: 1.8rem;
        text-align: center;
    }

    .app-subtitle {
        font-size: 0.88rem;
        text-align: center;
    }

    /* Hide category stats details on mobile to save space */
    .stats-card {
        padding: 15px;
        margin-top: 5px;
        width: 100%;
        max-width: 400px;
    }
    
    .category-stats-list {
        display: none; /* Hide detailed breakdown on mobile to keep header compact */
    }

    /* Controls Bar & Grid */
    .main-content {
        padding: 16px;
        gap: 20px;
    }

    .search-box {
        height: 52px;
        padding: 0 16px;
    }

    .search-box input {
        font-size: 0.95rem;
    }

    .filter-tab {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    .tab-count {
        font-size: 0.7rem;
        padding: 1px 5px;
    }

    .hooks-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Hook Cards on Mobile */
    .hook-card {
        padding: 18px;
        gap: 15px;
    }

    .hook-portuguese {
        font-size: 1.05rem;
    }

    .hook-english {
        font-size: 0.82rem;
        padding-left: 8px;
    }

    .copy-btn {
        height: 38px;
        font-size: 0.8rem;
    }

    .example-btn {
        width: 38px;
        height: 38px;
    }

    /* Center Toast on Mobile */
    .toast {
        bottom: 20px;
        left: 20px;
        right: 20px;
        justify-content: center;
        padding: 12px 20px;
    }
}

