/* ============================================
   AI TOOLS RANKING — MAIN STYLESHEET v2.0
   Theme: Book-type | Dark crimson & ember red
   Font: DM Sans | Glassmorphism cards
   ============================================ */

/* ============================================
   CSS VARIABLES & RESET
   ============================================ */

:root {
    /* Brand colors */
    --red-600:     #dc2626;
    --red-700:     #b91c1c;
    --red-500:     #ef4444;
    --red-400:     #f87171;
    --red-300:     #fca5a5;

    /* Dark backgrounds */
    --bg-base:     #0a0404;
    --bg-deep:     #0d0505;
    --bg-card:     rgba(22, 8, 8, 0.92);
    --bg-card-alt: rgba(28, 10, 10, 0.90);
    --bg-glass:    rgba(20, 8, 8, 0.70);

    /* Borders */
    --border-dim:  rgba(220, 38, 38, 0.12);
    --border-mid:  rgba(220, 38, 38, 0.22);
    --border-glow: rgba(220, 38, 38, 0.45);

    /* Text */
    --text-white:  #ffffff;
    --text-bright: #f0d8d8;
    --text-mid:    #c0a0a0;
    --text-muted:  #9b7070;
    --text-faint:  #7a5050;

    /* Accents */
    --gold:        #fbbf24;
    --gold-dim:    #d97706;
    --teal:        #06b6d4;
    --purple:      #a855f7;
    --green:       #10b981;
    --blue:        #3b82f6;
    --orange:      #f97316;

    /* Spacing */
    --radius-sm:   8px;
    --radius-md:   16px;
    --radius-lg:   20px;
    --radius-xl:   28px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-card: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.03);
    --shadow-hover: 0 20px 50px rgba(0,0,0,0.50), 0 0 30px rgba(220,38,38,0.15);
    --shadow-red:  0 6px 24px rgba(220,38,38,0.40);

    /* Transitions */
    --ease-out:    cubic-bezier(0.4, 0, 0.2, 1);
    --transition:  all 0.3s var(--ease-out);
}

/* Dark mode overrides */
[data-theme="dark"] {
    --bg-base:     #050202;
    --bg-deep:     #080303;
    --bg-card:     rgba(16, 5, 5, 0.96);
    --bg-glass:    rgba(14, 5, 5, 0.80);
    --text-mid:    #b09090;
    --text-muted:  #8a6060;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 18%, rgba(220,38,38,0.16) 0%, transparent 28%),
        radial-gradient(circle at 88% 22%, rgba(185,28,28,0.10) 0%, transparent 30%),
        radial-gradient(circle at 50% 85%, rgba(139,20,20,0.08) 0%, transparent 25%),
        linear-gradient(150deg,
            #0d0505 0%,
            #160909 20%,
            #1c0b0b 40%,
            #160808 60%,
            #0d0505 80%,
            #080303 100%);
}

/* Ambient glow layer */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background:
        radial-gradient(ellipse at 25% 25%, rgba(220,38,38,0.12), transparent 40%),
        radial-gradient(ellipse at 75% 65%, rgba(185,28,28,0.08), transparent 40%);
    filter: blur(50px);
    animation: ambientPulse 18s ease-in-out infinite alternate;
}

/* Grid texture */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 48px 48px;
}

@keyframes ambientPulse {
    from { opacity: 0.6; transform: scale(1); }
    to   { opacity: 1;   transform: scale(1.05); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(30px, -20px) scale(1.05); }
    66%       { transform: translate(-20px, 15px) scale(0.97); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #120606; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--red-500); }

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 28px;
}

@media (max-width: 768px) { .container { padding: 0 16px; } }

/* ============================================
   DARK MODE TOGGLE
   ============================================ */



/* ============================================
   BACK TO TOP
   ============================================ */

.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    border: none;
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-red);
    transition: var(--transition);
    animation: pulse-red 2.5s ease infinite;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(220,38,38,0.55);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    position: relative;
    padding: 100px 0 80px;
    overflow: hidden;
    isolation: isolate;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
    animation: fadeInUp 0.7s var(--ease-out) both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    border-radius: var(--radius-full);
    background: rgba(220,38,38,0.12);
    border: 1px solid rgba(220,38,38,0.28);
    color: var(--red-300);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.hero-badge i { color: var(--red-500); font-size: 11px; }

.hero-title {
    font-size: clamp(36px, 5.5vw, 68px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 22px;
    color: var(--text-white);
    animation: fadeInUp 0.6s var(--ease-out) 0.15s both;
}

.gradient-text {
    background: linear-gradient(135deg,
        #ffffff 0%,
        var(--red-300) 35%,
        var(--red-500) 60%,
        var(--red-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: shimmer 4s linear infinite;
}

.hero-description {
    font-size: 18px;
    color: var(--text-mid);
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.7;
    animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
}

/* ---- Search Bar ---- */

.search-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 25px auto 0;
    animation: fadeInUp 0.6s var(--ease-out) 0.25s both;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-faint);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 16px 52px 16px 50px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-mid);
    background: rgba(18, 6, 6, 0.85);
    backdrop-filter: blur(12px);
    color: var(--text-white);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
}

.search-input::placeholder { color: var(--text-faint); }

.search-input:focus {
    outline: none;
    border-color: var(--red-600);
    background: rgba(20, 6, 6, 0.97);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.14), 0 8px 32px rgba(0,0,0,0.3);
}

.search-clear {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-clear:hover {
    color: var(--red-400);
    background: rgba(220,38,38,0.10);
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(16, 5, 5, 0.97);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-mid);
    z-index: 200;
    display: none;
    overflow: hidden;
    box-shadow: 0 16px 50px rgba(0,0,0,0.5);
}

.search-suggestions.show { display: block; }

.suggestion-item {
    padding: 12px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-bright);
    font-size: 14px;
    transition: background 0.2s;
}

.suggestion-item i:first-child { color: var(--red-500); width: 20px; text-align: center; }
.suggestion-item:hover { background: rgba(220,38,38,0.10); }

/* ---- Hero Stats ---- */

.hero-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    animation: fadeInUp 0.6s var(--ease-out) 0.3s both;
}

.stat { display: flex; flex-direction: column; gap: 4px; }

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Animated Background Orbs ---- */

.hero-bg-animation {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: orbFloat 14s ease-in-out infinite;
}

.orb-1 { width: 400px; height: 400px; top: -10%;  left: -8%;  background: radial-gradient(circle, rgba(220,38,38,0.25), transparent 70%); animation-duration: 16s; }
.orb-2 { width: 300px; height: 300px; top: 20%;   right: -5%; background: radial-gradient(circle, rgba(185,28,28,0.15), transparent 70%); animation-duration: 12s; animation-delay: -4s; }
.orb-3 { width: 250px; height: 250px; bottom: 0;  left: 30%;  background: radial-gradient(circle, rgba(239,68,68,0.10), transparent 70%); animation-duration: 18s; animation-delay: -8s; }
.orb-4 { width: 180px; height: 180px; top: 10%;   left: 55%;  background: radial-gradient(circle, rgba(220,38,38,0.12), transparent 70%); animation-duration: 20s; animation-delay: -3s; }
.orb-5 { width: 220px; height: 220px; bottom: 20%; right: 20%; background: radial-gradient(circle, rgba(139,20,20,0.12), transparent 70%); animation-duration: 15s; animation-delay: -6s; }

/* ============================================
   DIVIDER
   ============================================ */

.section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(220,38,38,0.40) 25%,
        rgba(185,28,28,0.60) 50%,
        rgba(220,38,38,0.40) 75%,
        transparent 100%);
    margin: 0;
}

/* ============================================
   FILTERS SECTION
   ============================================ */

.filters-section {
    padding: 40px 0 32px;
    position: relative;
    z-index: 10;
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.filters-header .section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.filters-header .section-title i { color: var(--red-500); font-size: 16px; }

.clear-filters-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-dim);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
}

.clear-filters-btn:hover {
    border-color: var(--red-600);
    color: var(--red-400);
}

/* Filter chips row */
.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-mid);
    background: rgba(18, 6, 6, 0.65);
    backdrop-filter: blur(8px);
    color: var(--text-mid);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

/* Ripple */
.filter-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(220,38,38,0.18), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.filter-chip:hover::before { opacity: 1; }

.filter-chip:hover {
    border-color: var(--red-600);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(220,38,38,0.20);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-red);
    font-weight: 600;
}

.filter-chip .chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.15);
    font-size: 11px;
    font-weight: 700;
}

.filter-chip.active .chip-count { background: rgba(255,255,255,0.25); }

/* Trending chip special style */
.filter-chip[data-category="trending"] {
    border-color: rgba(251,191,36,0.30);
    color: var(--gold);
}

.filter-chip[data-category="trending"]:hover,
.filter-chip[data-category="trending"].active {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 20px rgba(217,119,6,0.40);
}

/* ============================================
   SECTION HEADERS (shared)
   ============================================ */

.section-header {
    margin-bottom: 40px;
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 10px;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i { color: var(--red-500); }

.section-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.65;
}

.date-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: rgba(220,38,38,0.12);
    border: 1px solid var(--border-mid);
    color: var(--red-300);
    font-size: 13px;
    font-weight: 600;
}

/* ============================================
   TOOLS SECTION
   ============================================ */

.tools-section { padding: 20px 0 60px; }

/* Sort select */
.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label { font-size: 13px; color: var(--text-muted); }

.sort-select {
    padding: 9px 16px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-mid);
    background: rgba(18, 6, 6, 0.80);
    backdrop-filter: blur(8px);
    color: var(--text-white);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239b7070' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.sort-select:focus {
    outline: none;
    border-color: var(--red-600);
}

.sort-select option {
    background: #180808;
    color: var(--text-white);
}

/* ============================================
   TOOLS GRID
   ============================================ */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

@media (max-width: 1280px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .tools-grid { grid-template-columns: 1fr; gap: 16px; } }

/* ============================================
   TOOL CARD
   ============================================ */

.tool-card {
    background: linear-gradient(145deg, var(--bg-card-alt), var(--bg-card));
    border: 1px solid rgba(255,255,255,0.055);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.35s var(--ease-out), border-color 0.35s ease, box-shadow 0.35s ease;
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.5s var(--ease-out) backwards;
    will-change: transform;
}

/* Top accent line */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red-600), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.tool-card:hover::before { opacity: 1; }

.tool-card:hover {
    transform: translateY(-7px);
    border-color: rgba(220,38,38,0.30);
    box-shadow: var(--shadow-hover);
}

/* Card header area with logo */
.tool-card-header {
    padding: 22px 22px 14px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
}

.tool-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-logo-wrap { transform: scale(1.06) rotate(-2deg); }

.tool-logo-wrap img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.tool-logo-wrap .logo-fallback {
    font-size: 22px;
    font-weight: 800;
    color: var(--red-400);
}

.tool-meta { flex: 1; min-width: 0; }

.tool-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-category-label {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.tool-category-label i { font-size: 10px; color: var(--red-500); }

/* Rank badge top-right */
.tool-rank-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(220,38,38,0.15);
    border: 1px solid rgba(220,38,38,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--red-300);
}

.tool-rank-badge.top3 {
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-red);
}

/* Score row */
.tool-score-row {
    padding: 0 22px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-stars {
    display: flex;
    gap: 2px;
}

.tool-stars i {
    font-size: 11px;
    color: var(--gold);
}

.tool-score-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
}

.tool-users {
    font-size: 11px;
    color: var(--text-faint);
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tool-users i { font-size: 9px; }

/* Description */
.tool-description {
    padding: 0 22px 14px;
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.65;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

/* Tags row */
.tool-tags {
    padding: 0 22px 14px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tool-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(220,38,38,0.08);
    border: 1px solid rgba(220,38,38,0.16);
    color: var(--red-300);
    font-size: 11px;
    font-weight: 500;
}

/* Badges row */
.tool-badges {
    padding: 0 22px 14px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.badge-trending {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(251,191,36,0.12);
    border: 1px solid rgba(251,191,36,0.25);
    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
}

.badge-trending i { font-size: 10px; }

.badge-pricing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-pricing.free     { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25); color: #34d399; }
.badge-pricing.freemium { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.25); color: #60a5fa; }
.badge-pricing.paid     { background: rgba(220,38,38,0.12);  border: 1px solid rgba(220,38,38,0.25);  color: var(--red-400); }

/* Card footer button */
.tool-card-footer {
    padding: 14px 22px 20px;
    margin-top: auto;
}

.tool-visit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-mid);
    background: transparent;
    color: var(--red-300);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.tool-visit-btn:hover {
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-red);
    transform: translateY(-1px);
}

/* Card animation delays */
.tool-card:nth-child(1)  { animation-delay: 0.05s; }
.tool-card:nth-child(2)  { animation-delay: 0.10s; }
.tool-card:nth-child(3)  { animation-delay: 0.15s; }
.tool-card:nth-child(4)  { animation-delay: 0.20s; }
.tool-card:nth-child(5)  { animation-delay: 0.25s; }
.tool-card:nth-child(6)  { animation-delay: 0.30s; }
.tool-card:nth-child(7)  { animation-delay: 0.35s; }
.tool-card:nth-child(8)  { animation-delay: 0.40s; }
.tool-card:nth-child(9)  { animation-delay: 0.45s; }
.tool-card:nth-child(10) { animation-delay: 0.50s; }
.tool-card:nth-child(11) { animation-delay: 0.55s; }
.tool-card:nth-child(12) { animation-delay: 0.60s; }

/* ============================================
   LOAD MORE & NO RESULTS
   ============================================ */

.load-more-container {
    text-align: center;
    padding: 12px 0 40px;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-mid);
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    color: var(--text-bright);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.load-more-btn:hover {
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-red);
    transform: translateY(-2px);
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.no-results i { font-size: 52px; color: var(--red-700); margin-bottom: 20px; display: block; opacity: 0.5; }
.no-results h3 { font-size: 22px; color: var(--text-mid); margin-bottom: 10px; }
.no-results p  { margin-bottom: 24px; font-size: 15px; }

.reset-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 28px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-mid);
    background: transparent;
    color: var(--red-400);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.reset-search-btn:hover {
    background: rgba(220,38,38,0.10);
    border-color: var(--red-500);
}

/* Loading spinner */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.loading-spinner i {
    font-size: 36px;
    color: var(--red-600);
    display: block;
    margin-bottom: 16px;
    animation: spinSlow 1s linear infinite;
}

.loading-spinner p { font-size: 15px; }

/* ============================================
   NEWS SECTION
   ============================================ */

.news-section {
    padding: 60px 0 80px;
    position: relative;
}

.news-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(220,38,38,0.35), transparent);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 1024px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .news-grid { grid-template-columns: 1fr; gap: 20px; } }

/* ---- News Card ---- */

.news-card {
    background: linear-gradient(145deg, var(--bg-card-alt), var(--bg-card));
    border: 1px solid rgba(255,255,255,0.055);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.5s var(--ease-out) backwards;
    position: relative;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

.news-card:hover::before { opacity: 1; }
.news-card:nth-child(1)::before { background: linear-gradient(90deg, transparent, var(--blue), transparent); }
.news-card:nth-child(2)::before { background: linear-gradient(90deg, transparent, var(--purple), transparent); }
.news-card:nth-child(3)::before { background: linear-gradient(90deg, transparent, var(--red-500), transparent); }

.news-card:hover {
    transform: translateY(-6px);
    border-color: rgba(220,38,38,0.25);
    box-shadow: var(--shadow-hover);
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }

/* News card top bar */
.news-card-top {
    padding: 20px 22px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.news-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: white;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-faint);
}

.news-meta i { font-size: 10px; }

/* News content */
.news-content { padding: 16px 22px; flex: 1; }

.news-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.news-card:hover .news-title { color: var(--red-300); }

.news-excerpt {
    font-size: 13.5px;
    color: var(--text-mid);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* news-full-content removed — replaced by reading modal */

/* News tags */
.news-tags {
    padding: 10px 22px 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.news-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    background: rgba(220,38,38,0.08);
    border: 1px solid rgba(220,38,38,0.14);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

/* News footer */
.news-card-footer {
    padding: 16px 22px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid var(--border-dim);
}

.news-source {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.news-source img {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-mid);
    background: transparent;
    color: var(--red-400);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.news-read-more:hover,
.news-read-more.active {
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 14px rgba(220,38,38,0.35);
}

/* ============================================
   TOOL DETAIL MODAL
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.25s ease;
}

.modal.show { display: flex; }

.modal-content {
    background: linear-gradient(145deg, #1e0808, #160606);
    border: 1px solid rgba(220,38,38,0.28);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 680px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.65), 0 0 50px rgba(220,38,38,0.12);
    animation: fadeInUp 0.35s var(--ease-out);
}

.modal-header {
    padding: 26px 28px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border-dim);
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.modal-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.modal-logo img { width: 34px; height: 34px; object-fit: contain; }

.modal-tool-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 4px;
}

.modal-tool-category {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-tool-category i { color: var(--red-500); font-size: 11px; }

.modal-close {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-dim);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.modal-close:hover {
    border-color: var(--red-500);
    color: var(--red-400);
    background: rgba(220,38,38,0.10);
}

.modal-body {
    padding: 24px 28px;
}

/* Modal score + badges */
.modal-score-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.modal-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-stars { display: flex; gap: 3px; }
.modal-stars i { font-size: 14px; color: var(--gold); }

.modal-score-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--gold);
}

/* Modal description */
.modal-description {
    font-size: 14.5px;
    color: var(--text-mid);
    line-height: 1.75;
    margin-bottom: 22px;
}

/* Modal info grid */
.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 22px;
}

.modal-info-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.modal-info-label {
    font-size: 11px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-info-label i { color: var(--red-600); font-size: 10px; }

.modal-info-value {
    font-size: 14px;
    color: var(--text-white);
    font-weight: 600;
}

/* Modal features */
.modal-features-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-features-title i { color: var(--red-500); }

.modal-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.modal-feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(220,38,38,0.10);
    border: 1px solid rgba(220,38,38,0.20);
    color: var(--red-300);
    font-size: 12px;
    font-weight: 500;
}

.modal-feature-chip i { font-size: 10px; color: var(--red-500); }

.modal-footer {
    padding: 18px 28px 24px;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border-dim);
    flex-wrap: wrap;
}

.modal-visit-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 24px;
    border-radius: var(--radius-full);
    border: none;
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
    color: white;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    min-width: 180px;
}

.modal-visit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
    gap: 12px;
}

.modal-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 24px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-mid);
    background: transparent;
    color: var(--text-mid);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    border-color: var(--red-500);
    color: var(--red-400);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast {
    position: fixed;
    bottom: 90px;
    right: 28px;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    animation: fadeInUp 0.3s ease;
}

.toast i { font-size: 16px; }

/* ============================================
   FAQ SECTION
   ============================================ */

.faq-section {
    padding: 20px 0 80px;
}

.faq-list {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--border-mid);
}

.faq-item.open {
    border-color: rgba(220,38,38,0.35);
    box-shadow: 0 4px 20px rgba(220,38,38,0.08);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-white);
    text-align: left;
    transition: var(--transition);
}

.faq-question:hover { color: var(--red-400); }
.faq-item.open .faq-question { color: var(--red-400); }

.faq-icon {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--red-600);
    transition: transform 0.3s var(--ease-out);
}

.faq-item.open .faq-icon { transform: rotate(180deg); }

.faq-answer {
    display: none;
    padding: 16px 24px 20px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-mid);
    border-top: 1px solid var(--border-dim);
    animation: fadeIn 0.25s ease;
}

.faq-answer p { margin: 0; }
.faq-answer strong { color: var(--text-bright); font-weight: 600; }
.faq-item.open .faq-answer { display: block; }

@media (max-width: 640px) {
    .faq-question { font-size: 14px; padding: 16px 18px; }
    .faq-answer   { padding: 14px 18px 16px; }
}

/* ============================================
   NEWS READING MODAL
   ============================================ */

.news-modal-content {
    max-width: 760px;
    max-height: 90vh;
}

.news-modal-header {
    padding: 16px 20px;
    justify-content: flex-end;
    border-bottom: 1px solid var(--border-dim);
    min-height: unset;
}

.news-modal-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.news-modal-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: white;
}

.news-modal-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.news-modal-meta i { font-size: 11px; }

.news-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.35;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.news-modal-source {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-dim);
}

.news-modal-source img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.news-modal-body-text {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-mid);
}

.news-modal-body-text p {
    margin-bottom: 18px;
}

.news-modal-body-text p:last-child {
    margin-bottom: 0;
}

.news-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-dim);
}

.news-modal-footer-link {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-dim);
}

/* ============================================
   NEWSLETTER SECTION
   ============================================ */


    .modal-content { border-radius: var(--radius-lg); }
    .modal-header { padding: 20px; }
    .modal-body { padding: 18px 20px; }
    .modal-info-grid { grid-template-columns: 1fr; }
    .modal-footer { flex-direction: column; padding: 16px 20px 20px; }
    .modal-visit-btn { min-width: unset; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 28px; }
    .hero-badge { font-size: 11px; }
    .search-input { font-size: 14px; padding: 14px 44px 14px 44px; }
    .filter-chip { font-size: 12px; padding: 8px 16px; }
    .tool-card-header { padding: 16px 16px 10px; }
    .tool-description { padding: 0 16px 12px; }
    .tool-tags { padding: 0 16px 12px; }
    .tool-badges { padding: 0 16px 12px; }
    .tool-card-footer { padding: 12px 16px 16px; }
    .news-card-top { padding: 16px 16px 0; }
    .news-content { padding: 14px 16px; }
    .news-full-content { padding-left: 16px; padding-right: 16px; }
    .news-tags { padding: 8px 16px 0; }
    .news-card-footer { padding: 14px 16px 16px; }
    .back-to-top { bottom: 20px; right: 20px; }
}