/**
 * ==========================================
 * POREXO.COM - PREMIUM STYLE SHEET
 * Framework: Bootstrap 5 + Custom Tweaks
 * ========================================== 
 */

:root {
    --primary-color: #4f46e5; /* Indigo-600 */
    --secondary-color: #7c3aed; /* Purple-600 */
    --accent-color: #10b981; /* Emerald-500 */
    --dark-bg: #111827; /* Gray-900 */
    --light-bg: #f9fafb; /* Gray-50 */
    --text-main: #1f2937; /* Gray-800 */
    --text-muted: #6b7280; /* Gray-500 */
    --border-color: #e5e7eb; /* Gray-200 */
}

/* --- 1. GLOBAL RESETS --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

a {
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* --- 2. SEARCH SUGGESTIONS (FIXED UI - UPDATED) --- */

/* NEW: For search.js generated dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    margin-top: 0;
    animation: fadeIn 0.2s ease-out;
}

/* Suggestion Items - Fixed small images */
.search-suggestions .suggestion-item {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
    transition: background 0.2s, padding-left 0.2s;
    cursor: pointer;
    color: var(--text-main);
}

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

.search-suggestions .suggestion-item:hover,
.search-suggestions .suggestion-item:focus {
    background-color: #eef2ff; /* Light Indigo Tint */
    padding-left: 16px; /* Slight slide effect */
    outline: none;
}

.search-suggestions .suggestion-item:focus {
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2) inset;
}

/* FIXED: Images now 40x40px */
.search-suggestions .suggestion-item img {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background-color: #f3f4f6;
}

/* Custom Scrollbar for suggestions */
.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 0 12px 0;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* OLD: Legacy dropdown styles (for backward compatibility) */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 9999 !important;
    overflow: hidden;
    margin-top: 2px;
}

/* List Items */
.dropdown-item-custom {
    display: flex !important;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
    transition: background 0.2s;
    cursor: pointer;
    color: var(--text-main);
}

.dropdown-item-custom:last-child {
    border-bottom: none;
}

.dropdown-item-custom:hover {
    background-color: #eef2ff; /* Light Indigo Tint */
    padding-left: 20px; /* Slight slide effect */
}

/* Header */
.dropdown-header {
    background: #f8f9fa;
    padding: 8px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

/* Images (Fixed Size - 40x40px) */
.suggestion-img {
    width: 40px !important;
    height: 40px !important;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    background-color: #f3f4f6;
}

/* Icons Fallback */
.suggestion-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 6px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 1.2rem;
    color: #9ca3af;
    flex-shrink: 0;
}

/* --- 3. CODE BLOCKS (DARK MODE) --- */
.code-block {
    background: #1e293b; /* Slate-800 */
    border-radius: 8px;
    border: 1px solid #334155;
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #0f172a; /* Slate-900 */
    border-bottom: 1px solid #334155;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: #94a3b8;
}

.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    color: #e2e8f0;
    background: transparent;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Copy Button */
.copy-btn {
    background: #334155;
    border: 1px solid #475569;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #475569;
}

/* --- 4. ARTICLE TYPOGRAPHY --- */
.article-content {
    font-size: 1.05rem;
    color: #374151;
}

.article-content h2 {
    color: var(--dark-bg);
    font-weight: 800;
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-content h3 {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.article-content ul, 
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}

.article-content a:hover {
    color: var(--secondary-color);
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: #eef2ff;
    padding: 1.2rem 1.5rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4338ca;
    margin: 2rem 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    margin: 20px 0;
}

/* --- 5. ANIMATIONS --- */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.search-dropdown,
.search-suggestions {
    animation: fadeIn 0.2s ease-out;
}

/* --- 6. UTILITIES --- */
.hover-lift {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.hover-shadow:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Search Input Focus */
.form-control:focus {
    box-shadow: none;
    border-color: var(--primary-color);
    outline: none;
}

/* --- 7. RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .search-suggestions,
    .search-dropdown {
        max-height: 300px;
    }
    
    .suggestion-img,
    .suggestion-icon {
        width: 35px !important;
        height: 35px !important;
    }
    
    .search-suggestions .suggestion-item img {
        width: 35px !important;
        height: 35px !important;
        min-width: 35px;
        min-height: 35px;
    }
}

/* --- 8. LOADING STATE --- */
.search-suggestions.loading::after {
    content: "Searching...";
    display: block;
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- 9. FAQ SECTION STYLING (ADDED) --- */
.faq-item {
    background-color: #ffffff;
    border: 1px solid #e0e7ff;
    border-left: 5px solid #4f46e5; /* Left colorful border */
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease-in-out;
}

/* Hover Effect */
.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(79, 70, 229, 0.15);
    border-color: #4f46e5;
}

/* FAQ Question (Heading) */
.faq-item h3 {
    color: #4338ca;
    font-weight: 700;
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

/* Question Icon */
.faq-item h3::before {
    content: "❓";
    margin-right: 10px;
    font-size: 1rem;
    background: #e0e7ff;
    padding: 5px 10px;
    border-radius: 50%;
}

/* FAQ Answer */
.faq-item p {
    color: #4b5563;
    line-height: 1.7;
    font-size: 1rem;
    margin-bottom: 0;
}

/* Dark Mode Support for FAQs */
@media (prefers-color-scheme: dark) {
    .faq-item {
        background-color: #1e293b;
        border-color: #334155;
        border-left-color: #6366f1;
    }
    .faq-item h3 {
        color: #e2e8f0;
    }
    .faq-item h3::before {
        background: #334155;
    }
    .faq-item p {
        color: #94a3b8;
    }
}