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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

:root {
    --primary-color: #38bdf8;
    /* Cyan */
    --primary-hover: #0ea5e9;
    --secondary-color: #34d399;
    /* Vibrant emerald */
    --accent-gold: #fbbf24;
    /* Premium Gold */
    --dark-bg: #030712;
    --card-bg: rgba(17, 24, 39, 0.6);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-bright: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
}

/* Background animated glow */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(251, 191, 36, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.04) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundMove 40s ease-in-out infinite alternate;
}

@keyframes backgroundMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(5%, 5%) rotate(3deg);
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-bottom: 60px;
}

/* Glassmorphism Card Style */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.glass::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

/* Header Styling */
header {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 50px 20px;
    text-align: center;
    position: relative;
    border-radius: 24px;
}

.header-logo-container {
    margin-bottom: 20px;
}

.header-search-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.4));
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.4));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 25px rgba(56, 189, 248, 0.6));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.4));
    }
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(to bottom, #ffffff, var(--accent-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(251, 191, 36, 0.2);
}

header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Search Card Styling */
.search-card-wrapper {
    padding: 40px 30px;
    border: 1px solid var(--glass-border-bright);
}

.search-card-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 20px;
}

.search-card-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.search-card-header p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Google CSE Overrides to match Al-Shehab dark glassmorphic theme */
.gsc-control-cse {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-family: 'Vazirmatn', sans-serif !important;
}

/* Hide default google brand watermark */
.gcsc-branding {
    display: none !important;
}

/* Google CSE Table Structure Flex Transformation */
form.gsc-search-box,
table.gsc-search-box,
table.gsc-search-box tbody,
table.gsc-search-box tr {
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
    position: relative !important;
}

td.gsc-input {
    flex-grow: 1 !important;
    display: block !important;
}

td.gsc-search-button {
    position: absolute !important;
    right: 8px !important;
    left: auto !important;
    /* Place inside input box capsule on the right (RTL) */
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: block !important;
    z-index: 10 !important;
}

/* Clear search "X" button customization */
.gsst_a {
    padding: 0 !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
}

.gsst_b {
    font-size: 1.2rem !important;
    color: var(--text-muted) !important;
    line-height: 1 !important;
}

.gsst_b:hover {
    color: var(--accent-gold) !important;
}

/* Input search box area */
.gsc-input-box {
    position: relative !important; /* Anchor for custom absolute positioned clear button */
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 40px !important;
    height: 60px !important;
    /* Slightly taller for grandeur */
    padding: 0 70px 0 50px !important; /* Premium left padding to prevent overlapping with clear button */
    /* Extra padding on the right (RTL) for the floated button */
    display: flex !important;
    align-items: center !important;
    box-shadow: inset 0 3px 15px rgba(0, 0, 0, 0.6) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    direction: rtl !important;
}

.gsc-input-box:focus-within,
.gsc-input-box:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.25), inset 0 3px 15px rgba(0, 0, 0, 0.6) !important;
}

/* Reset inner CSE inputs and remove duplicate grey search icon */
.gsc-input-box *,
.gsc-input-box-focus *,
.gsc-input-box,
.gsc-input-box-focus,
input.gsc-input,
input.gsc-input:focus,
input#gsc-i-id1,
input#gsc-i-id1:focus,
.gsc-control-cse input.gsc-input {
    background-image: none !important;
    background: transparent !important;
}

input.gsc-input {
    color: var(--text-primary) !important;
    font-size: 1.15rem !important;
    font-family: inherit !important;
    height: 100% !important;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
}

/* Custom Clear Search Button inside Google's input box capsule */
.custom-clear-search-btn {
    position: absolute !important;
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(239, 68, 68, 0.08) !important; /* Premium soft red default background */
    border: 1px solid rgba(239, 68, 68, 0.25) !important; /* Soft red border */
    color: #f87171 !important; /* Beautiful readable red icon */
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 12 !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1) !important;
}

.custom-clear-search-btn:hover {
    background: rgba(239, 68, 68, 0.18) !important; /* Vibrant red glow on hover */
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #ffffff !important; /* White icon on hover for contrast */
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35) !important;
}

.custom-clear-search-btn i {
    font-size: 0.85rem !important;
    transition: transform 0.3s ease !important;
    display: block !important;
}

.custom-clear-search-btn:hover i {
    transform: rotate(90deg) !important;
}

/* Search button custom styling - Floating Golden Circle */
button.gsc-search-button-v2 {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d4af37 100%) !important;
    border: none !important;
    border-radius: 50% !important;
    /* Perfect circle */
    width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

button.gsc-search-button-v2:hover {
    background: linear-gradient(135deg, #fef08a 0%, var(--accent-gold) 100%) !important;
    transform: scale(1.08) !important;
    box-shadow: 0 0 25px var(--accent-gold), 0 0 10px rgba(251, 191, 36, 0.5) !important;
}

button.gsc-search-button-v2:active {
    transform: scale(0.92) !important;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4) !important;
}

button.gsc-search-button-v2 svg {
    fill: #030712 !important;
    /* Dark icon contrast on gold button */
    width: 18px !important;
    height: 18px !important;
}

/* Search results wrapper styling - Centered and limited in width for academic look */
.gsc-results-wrapper-visible {
    background: transparent !important;
    margin-top: 40px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding-top: 30px !important;
    max-width: 850px !important;
    /* Elegant centered width for results list */
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

/* Single search result block - Styled as premium citation cards */
.gsc-webResult.gsc-result {
    background: rgba(17, 24, 39, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-right: 4px solid transparent !important;
    /* Elegant right border accent for RTL */
    border-radius: 20px !important;
    padding: 24px !important;
    margin-bottom: 24px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    animation: resultReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    
    /* Responsive safety features */
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Prevent content overflowing visually */
}

/* Convert Google's search result table layout into responsive block layouts */
.gsc-table-result,
.gsc-table-result tbody,
.gsc-table-result tr,
.gsc-table-result td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.gsc-table-cell-thumbnail,
.gsc-thumbnail {
    display: block !important;
    max-width: 100% !important;
    margin-bottom: 12px !important;
}

/* Ensure snippet and titles wrap cleanly */
.gs-title,
.gs-title * {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
}

.gs-snippet {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

@keyframes resultReveal {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gsc-webResult.gsc-result:hover {
    background: rgba(17, 24, 39, 0.5) !important;
    border-color: rgba(251, 191, 36, 0.2) !important;
    border-right-color: var(--accent-gold) !important;
    /* Gold slide glow highlight */
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7) !important;
}

/* Result titles */
.gs-title,
.gs-title * {
    color: var(--accent-gold) !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    transition: color 0.3s ease !important;
}

.gs-title:hover,
.gs-title *:hover {
    color: #fef08a !important;
    text-decoration: underline !important;
}



/* Result snippets */
.gs-snippet {
    color: #cbd5e1 !important;
    font-size: 1rem !important;
    line-height: 1.8 !important;
    margin-top: 10px !important;
}

/* Result URLs - Styled as modern capsule tags */
.gs-visibleUrl {
    color: var(--secondary-color) !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    flex-wrap: wrap !important; /* Allow breadcrumbs to wrap on small screens */
    word-break: break-all !important; /* Break long words/links if necessary */
    overflow-wrap: break-word !important;
    max-width: 100% !important; /* Contain it within the result card */
    align-items: center !important;
    gap: 6px !important;
    background: rgba(52, 211, 153, 0.08) !important;
    border: 1px solid rgba(52, 211, 153, 0.2) !important;
    padding: 3px 12px !important;
    border-radius: 30px !important;
    margin-top: 12px !important;
    letter-spacing: 0.5px !important;
}

/* Show ONLY the breadcrumb style URL and hide others */
.gsc-url-top,
.gs-url-top,
.gs-visibleUrl-short,
.gs-visibleUrl-long {
    display: none !important;
}

/* Ensure the bottom URL container is visible to show the breadcrumbs inside it */
.gsc-url-bottom,
.gs-url-bottom {
    display: block !important;
}

/* Hide duplicate title link inside the bottom URL container */
.gsc-url-bottom a.gs-title,
.gs-url-bottom a.gs-title,
.gsc-url-bottom .gs-title,
.gs-url-bottom .gs-title {
    display: none !important;
}

/* Hide the first URL (long URL) in the bottom container, and show only the last URL (breadcrumb) */
.gsc-url-bottom .gs-visibleUrl:first-of-type,
.gs-url-bottom .gs-visibleUrl:first-of-type {
    display: none !important;
}

.gsc-url-bottom .gs-visibleUrl:last-of-type,
.gs-url-bottom .gs-visibleUrl:last-of-type,
.gs-visibleUrl-breadcrumb {
    display: inline-flex !important;
}

/* Pagination container */
.gsc-cursor-box {
    margin-top: 40px !important;
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
}

/* Pagination buttons */
.gsc-cursor-page {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: var(--transition-smooth) !important;
}

.gsc-cursor-page:hover {
    background: var(--accent-gold) !important;
    color: #030712 !important;
    border-color: var(--accent-gold) !important;
    transform: translateY(-2px) !important;
}

.gsc-cursor-current-page {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
}

/* Bottom Actions Navigation Card */
.navigation-card {
    padding: 30px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    border-color: rgba(251, 191, 36, 0.15);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.04) 0%, transparent 100%);
}

.navigation-card-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navigation-icon {
    font-size: 2.8rem;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.2));
}

.navigation-card-content h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 5px;
}

.navigation-card-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition-smooth);
    cursor: pointer;
    white-space: nowrap;
}

.btn-outline-gold {
    background: transparent;
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.1);
}

.btn-outline-gold:hover {
    background: var(--accent-gold);
    color: #030712;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(25px);
    animation: reveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .navigation-card {
        justify-content: space-between;
        text-align: right;
        flex-direction: row;
        gap: 20px;
    }

    .navigation-card-content {
        flex-direction: row;
        text-align: right;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 35px 15px !important;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }

    header h1 {
        font-size: 2.2rem;
    }

    header p {
        font-size: 1.05rem;
    }

    .search-card-wrapper {
        padding: 30px 20px;
    }

    .navigation-card {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        padding: 20px;
    }

    .navigation-card-content {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        width: 100%;
        text-align: center;
    }

    .navigation-card-content div {
        text-align: right;
    }
}

@media (max-width: 576px) {
    header h1 {
        font-size: 1.8rem !important;
    }
    
    header p {
        font-size: 0.95rem !important;
    }

    .search-card-wrapper {
        padding: 20px 12px !important;
        border-radius: 20px !important;
    }

    .search-card-header h2 {
        font-size: 1.25rem !important;
    }
    
    .search-card-header p {
        font-size: 0.88rem !important;
    }

    /* Suggestions mobile responsiveness */
    .search-suggestions {
        flex-direction: column !important;
        gap: 12px !important;
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }
    
    .suggestion-tags {
        justify-content: center !important;
        width: 100% !important;
    }

    /* Bottom actions card mobile responsiveness */
    .navigation-card {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
        padding: 24px 16px !important;
        border-radius: 20px !important;
    }
    
    .navigation-card-content {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
        width: 100% !important;
        gap: 12px !important;
    }
    
    .navigation-card-content div {
        text-align: center !important;
    }

    .navigation-icon {
        font-size: 2.4rem !important;
        margin-bottom: 5px;
    }

    .sites-avatars-mini {
        justify-content: center !important;
        margin-top: 8px !important;
    }
    
    .navigation-card .btn {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {
    .gsc-cursor-page {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
    }
}

/* --- Dynamic Search Elements Styling --- */

/* 1. Google Search Container Initial State */
.google-search-container {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease, max-height 0.8s ease;
    max-width: 760px !important;
    /* Centered narrow width for elegant search */
    margin: 0 auto !important;
    width: 100% !important;
}

.google-search-container.visible {
    opacity: 1;
    max-height: none !important;
    overflow: visible;
}

/* 2. Skeleton Loader Styling */
.skeleton-loader-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    transition: opacity 0.4s ease;
    padding: 10px 0;
    max-width: 760px !important;
    margin: 0 auto !important;
}

.skeleton-input-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 20px;
    position: relative;
    overflow: hidden;
}

.skeleton-input-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
    100% {
        left: 150%;
    }
}

.skeleton-placeholder-text {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

.skeleton-btn {
    width: 48px;
    height: 40px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
}

.skeleton-pulse-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.spinner-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulseDot 1.2s infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.4);
        opacity: 1;
    }
}

/* 3. Search Suggestions Styling */
.search-suggestions {
    margin-top: 30px;
    padding-top: 24px;
    padding-bottom: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    max-width: 760px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
    /* Center suggested tags */
}

.suggestion-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-title i {
    color: var(--accent-gold);
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
        filter: drop-shadow(0 0 4px var(--accent-gold));
    }
}

.suggestion-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.suggestion-tag {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
}

.suggestion-tag:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

/* 4. Circular Avatars list inside bottom card */
.sites-avatars-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.sites-avatars-mini img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.15);
    transition: var(--transition-smooth);
    cursor: pointer;
    object-fit: cover;
    margin-left: -8px;
    /* Beautiful stacked effect */
}

.sites-avatars-mini img:hover {
    transform: scale(1.25) translateY(-3px);
    z-index: 10;
    margin-left: 0;
    margin-right: 8px;
    box-shadow: 0 0 15px var(--accent-gold);
}

.more-badge {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--accent-gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    margin-right: 12px;
    letter-spacing: 0.5px;
}

/* --- Upgraded Styling for Suggestion Tag Icons & Fallback Search Block --- */

.suggestion-tag i {
    margin-left: 6px;
    font-size: 0.85rem;
    color: var(--accent-gold);
    transition: var(--transition-smooth);
}

.suggestion-tag:hover i {
    transform: scale(1.2) rotate(10deg);
}

/* Fallback search styling */
.search-fallback-wrapper {
    margin-top: 30px;
    padding: 35px 30px;
    border: 1px solid rgba(251, 191, 36, 0.15) !important;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.03) 0%, rgba(17, 24, 39, 0.6) 100%) !important;
    border-radius: 20px;
    text-align: center;
    max-width: 760px;
    margin: 20px auto;
    width: 100%;
    animation: fallbackFadeIn 0.5s ease-out;
}

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

.fallback-warning {
    margin-bottom: 25px;
}

.fallback-warning i {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3));
}

.fallback-warning h4 {
    font-size: 1.3rem;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 700;
}

.fallback-warning p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.6;
}

.fallback-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    max-width: 550px;
    margin: 0 auto 15px auto;
}

.fallback-input-group input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 12px 24px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
    font-family: inherit;
    direction: rtl;
}

.fallback-input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.25), inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.fallback-input-group button {
    padding: 12px 28px;
}

.fallback-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .fallback-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .fallback-input-group input {
        width: 100%;
        text-align: center;
    }
    
    .fallback-input-group button {
        width: 100%;
    }
}

/* --- Results Layout and Horizontal Pagination Fixes --- */

/* Force Google CSE pagination buttons to display horizontally */
.gsc-cursor-box {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 40px !important;
    flex-wrap: wrap !important;
}

/* Keep all descendants of the paging box aligned horizontally */
.gsc-cursor-box * {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
}

.gsc-cursor-page {
    display: inline-flex !important;
    margin: 0 4px !important;
}

/* --- Premium Custom Search Refinement Filters --- */

/* Hide Google's default refinements/tabs completely */
.gsc-tabsArea,
.gsc-tabsAreaGhost,
.gsc-refinementsArea,
.gsc-refinementsAreaGhost {
    display: none !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Custom search filters container */
.search-filters-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 760px;
    margin: 25px auto 10px auto !important;
    padding: 0 10px !important;
    animation: fadeInFilter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.search-filters-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 12px auto !important;
    padding: 0 !important;
    flex-wrap: wrap;
    width: 100%;
}

.filter-tab {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: var(--text-secondary) !important;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.filter-tab i {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.filter-tab:hover {
    background: rgba(56, 189, 248, 0.05) !important;
    border-color: rgba(56, 189, 248, 0.25) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.filter-tab:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.filter-tab.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(17, 24, 39, 0.7)) !important;
    border-color: var(--accent-gold) !important;
    color: var(--accent-gold) !important;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.05) !important;
}

.filter-tab.active i {
    color: var(--accent-gold);
    transform: scale(1.1);
}

/* Beautiful dynamic filter status tip box */
.filter-status-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.04), rgba(17, 24, 39, 0.7));
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 14px;
    padding: 10px 20px;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    width: 100%;
    max-width: 580px;
    margin: 4px auto 10px auto;
    text-align: center;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideDownTip 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
}

@keyframes slideDownTip {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.filter-status-tip i {
    color: var(--accent-gold);
    margin-left: 8px; /* RTL Spacing */
    font-size: 0.95rem;
    animation: goldPulse 2s infinite ease-in-out;
}

@keyframes goldPulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.4));
    }
    50% {
        opacity: 1;
        transform: scale(1.12);
        filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.8));
    }
    100% {
        opacity: 0.7;
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.4));
    }
}

@media (max-width: 600px) {
    .search-filters-container {
        margin: 20px auto 5px auto !important;
    }
    
    .search-filters-tabs {
        gap: 8px;
        margin-bottom: 10px !important;
    }
    
    .filter-tab {
        padding: 8px 18px;
        font-size: 0.85rem;
    }
    
    .filter-status-tip {
        padding: 8px 15px;
        font-size: 0.8rem;
        border-radius: 12px;
        margin-bottom: 5px;
    }
    
    .filter-status-tip i {
        font-size: 0.85rem;
    }

    .gsc-webResult.gsc-result {
        padding: 16px 12px !important;
        border-radius: 16px !important;
        margin-bottom: 16px !important;
    }
}