/* --- Modern Lenny Face Generator Theme --- */
:root {
    --bg-color: #ffffff;
    --sidebar-bg: #f8fafc;
    --text-color: #1e293b;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --hover-bg: #f1f5f9;
    --success-color: #10b981;
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.search-bar {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    outline: none;
}

.search-bar:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.category-nav ul {
    list-style: none;
}

.category-nav li {
    margin-bottom: 0.5rem;
}

.filter-link {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.filter-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.filter-link:hover::before {
    left: 100%;
}

.filter-link:hover {
    background-color: var(--hover-bg);
    transform: translateX(5px);
}

.filter-link.active {
    background: var(--gradient-bg);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* --- Main Content --- */
.main-content {
    margin-left: 300px; /* Same as sidebar width */
    padding: 2.5rem;
    width: calc(100% - 300px);
    min-height: 100vh;
}

/* --- FAQ Section --- */
.faq-section {
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.faq-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    user-select: none;
}

.faq-question:hover {
    background: var(--hover-bg);
}

.faq-question h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.faq-toggle {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    transition: transform 0.3s ease;
    min-width: 20px;
    text-align: center;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    background: rgba(248, 250, 252, 0.8);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.faq-answer p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    font-size: 0.95rem;
}

.face-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.face-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    user-select: none;
}

.face-card.hidden {
    display: none;
}

.face-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-bg);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.face-card:hover::before {
    opacity: 0.1;
}

.face-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 1);
}

.face-card:active {
    transform: translateY(-4px) scale(1.02);
    transition: all 0.1s ease;
}

/* --- Tooltip --- */
.tooltip {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip.active {
    bottom: 2rem;
    transform: translateX(-50%) scale(1.05);
}

/* --- Responsive Design for Mobile --- */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }
    .face-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    .face-card {
        padding: 1rem;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .face-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    .face-card {
        padding: 0.875rem;
        font-size: 1.1rem;
    }
    .logo {
        font-size: 1.5rem;
    }
    .faq-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    .faq-title {
        font-size: 1.5rem;
    }
    .faq-question {
        padding: 1rem;
    }
    .faq-question h3 {
        font-size: 1rem;
    }
}

/* --- Additional Modern Enhancements --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.face-card {
    animation: fadeInUp 0.6s ease-out;
}

.face-card:nth-child(1) { animation-delay: 0.1s; }
.face-card:nth-child(2) { animation-delay: 0.2s; }
.face-card:nth-child(3) { animation-delay: 0.3s; }
.face-card:nth-child(4) { animation-delay: 0.4s; }
.face-card:nth-child(5) { animation-delay: 0.5s; }
.face-card:nth-child(6) { animation-delay: 0.6s; }
.face-card:nth-child(7) { animation-delay: 0.7s; }
.face-card:nth-child(8) { animation-delay: 0.8s; }

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Loading animation for face cards */
.face-card.loading {
    animation: pulse 1.5s infinite;
}

/* Enhanced focus states for accessibility */
.filter-link:focus,
.search-bar:focus,
.face-card:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1e293b;
        --sidebar-bg: #0f172a;
        --text-color: #f1f5f9;
        --border-color: #334155;
        --hover-bg: #1e293b;
    }
    
    body {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    }
}