/* === FINAL V9 - PROFESSIONAL & MOBILE RESPONSIVE === */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&display=swap');

:root {
    --gradient-text: linear-gradient(90deg, #A78BFA, #F472B6, #FBBF24);
    --dark-bg: #1F2937;
    --card-bg: #374151;
    --darker-card-bg: #111827;
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --border-color: #4B5563;
    --primary-color: #A78BFA;
    --hero-bg: #1F2937; /* Used for trending button background */
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--dark-bg);
    color: var(--text-secondary);
    line-height: 1.6;
    padding-bottom: 90px;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-title { font-size: 2.2em; font-weight: 800; color: var(--text-primary); margin-bottom: 50px; text-align: center; }
.section-title-small { font-size: 1.5em; font-weight: 700; color: var(--text-primary); margin-bottom: 25px; text-align: center; }
section { padding: 40px 0; }

/* === HEADER & NAVIGATION === */
header { background-color: rgba(31, 41, 55, 0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000; }
.header-container { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
.logo { font-size: 1.4em; font-weight: 800; color: var(--text-primary); text-decoration: none; }
.logo img { height: 40px; width: auto; display: block; }
nav { display: none; } /* Hide for mobile by default */
.menu-toggle { display: block; background:none; border:none; color:var(--text-primary); cursor:pointer; z-index: 1001;} /* Mobile Menu Button */
nav.active { display:block; position:fixed; top:0; left:0; right:0; bottom:0; background:var(--dark-bg); }
nav.active ul { flex-direction: column; padding: 80px 20px 20px 20px; height:100%; align-items: center; gap: 20px; }

/* Desktop Navigation */
@media (min-width: 992px) {
    .menu-toggle { display: none; }
    nav { display: block !important; position: static; width: auto; background: none; }
    nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: row; align-items: center; gap: 25px; height: auto; }
    nav ul li { position: relative; padding-bottom: 15px; margin-bottom: -15px; }
    nav ul li a { text-decoration: none; color: var(--text-secondary); font-weight: 500; padding: 10px 5px; transition: color 0.3s ease; }
    nav ul li a:hover { color: var(--text-primary); }
    .submit-button { background: var(--gradient-text); color: #ffffff !important; padding: 8px 18px; border-radius: 50px; font-weight: 600; }
    nav ul li ul { display: none; opacity: 0; visibility: hidden; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background-color: #1F2937; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0,0,0,0.3); padding: 10px 0; min-width: 260px; transition: opacity 0.2s ease, visibility 0.2s ease; }
    nav ul li:hover > ul { display: block; opacity: 1; visibility: visible; }
    nav ul li ul.mega-menu { min-width: 500px; padding: 20px; columns: 2; -webkit-columns: 2; -moz-columns: 2;}
    nav ul li ul li { padding: 0; margin: 0; }
    nav ul li ul li a { color: var(--text-secondary); padding: 8px 15px; display: block; white-space: nowrap; border-radius: 4px; }
    nav ul li ul li a:hover { background-color: rgba(255,255,255,0.05); color: var(--text-primary); }
}

/* === HOMEPAGE & GENERAL CARD STYLES === */
.main-title-section { text-align: center; padding: 28px 20px 12px 20px; }
.site-name-heading { font-size: 1.5em; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.main-title-section h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.4em;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #ffffff;
}

.main-title-section .subtitle { font-size: 1em; color: var(--text-secondary); margin: 0 auto 10px auto; max-width: 600px; text-align:center; }
.trending-section { padding-top: 0; padding-bottom: 10px; }
.trending-boxes { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }

/* === STYLE FOR GRADIENT TRENDING BUTTONS - RESTORED === */
.trending-btn {
  display: inline-block;
  border-radius: 999px;
  padding: 2px; /* thickness of gradient border */
  background: linear-gradient(90deg, #ff7ab6 0%, #ffb86b 50%, #ffd86b 100%);
  margin: 8px 8px 8px 0;
  text-decoration: none;
  box-sizing: border-box;
}

.trending-btn > span {
  display: inline-block;
  border-radius: 999px;
  padding: 8px 18px;
  background: var(--hero-bg); /* This keeps the inner pill matching the hero bg */
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  text-align: center;
}

.categories { border-top: 1px solid #374151; }
.category-grid-5 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tool-grid { display: grid; gap: 25px; grid-template-columns: 1fr; } /* Default to 1 column */
@media(min-width: 768px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media(min-width: 992px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }

.category-card, .tool-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 25px; text-decoration: none; color: inherit; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.category-card:hover, .tool-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); }
.card-icon { font-size: 1.8em; margin-bottom: 15px; }
.category-card h3 { margin: 0 0 5px 0; font-size: 1.1em; font-weight: 600; color: var(--text-primary); }
.category-card p { margin: 0; color: var(--text-secondary); font-size: 0.9em; }
.view-all-card { background-color: var(--darker-card-bg); text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.view-all-card h3 { background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; }
.tool-card { padding: 0; }
.tool-card-content { padding: 25px; }
.tool-card-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.tool-card-logo { width: 45px; height: 45px; border-radius: 8px; object-fit: cover; }
.tool-card-title h3 { margin: 0; font-size: 1.15em; font-weight: 600; color: var(--text-primary); }
.tool-card-description { font-size: 0.95em; color: var(--text-secondary); }

/* === CATEGORY PAGE === */
.category-page-container { display: grid; grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
@media (min-width: 992px) { .category-page-container { grid-template-columns: 280px 1fr; } }
.category-sidebar { background-color: var(--darker-card-bg); padding: 25px; border-radius: 12px; height: fit-content; border: 1px solid var(--border-color); }
@media (min-width: 992px) { .category-sidebar { position: sticky; top: 100px; } }
.category-sidebar h3 { margin-top: 0; color: var(--text-primary); padding-bottom: 15px; border-bottom: 1px solid var(--border-color); font-size: 1.2em; }
.category-filter-list { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow-y: auto; }
.category-filter-list li a { display: flex; justify-content: space-between; padding: 10px; border-radius: 5px; color: var(--text-secondary); text-decoration: none; font-weight: 500; transition: background-color 0.2s ease, color 0.2s ease; }
.category-filter-list li a:hover { background-color: var(--card-bg); color: var(--text-primary); }
.category-filter-list li a.active { background-color: var(--primary-color); color: #ffffff; }
.category-main-content { min-width: 0; }
.category-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; flex-wrap:wrap; gap:15px; }
.category-header h1 { margin: 0; font-size: 2em; background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; }
.view-toggle button { background: none; border: 1px solid var(--border-color); color: var(--text-secondary); padding: 8px; border-radius: 5px; cursor: pointer; margin-left: 10px; line-height: 1; }
.view-toggle button.active { background-color: var(--primary-color); color: #ffffff; border-color: var(--primary-color); }
.view-toggle svg { width: 20px; height: 20px; vertical-align: middle; }

/* === LIST & GRID VIEW === */
.list-view { display: flex; flex-direction: column; gap: 20px; }
.list-view .tool-card { display: flex; flex-direction: column; align-items: stretch; padding: 0; }
@media (min-width: 576px) { .list-view .tool-card { flex-direction: row; align-items: center; } }
.list-view .tool-card-header { padding: 20px; }
@media (min-width: 576px) { .list-view .tool-card-header { flex: 0 0 250px; } }
.list-view .tool-card-description { padding: 20px; font-size: 0.95em; color: var(--text-secondary); }
@media (min-width: 576px) { .list-view .tool-card-description { border-left: 1px solid var(--border-color); } }

/* === FORMS, FOOTER, SEARCH === */
.submission-form, .login-card { max-width: 700px; margin: 0 auto; background: #111827; padding: 25px; border-radius: 16px; border: 1px solid var(--border-color); }
.login-card { max-width: 400px; text-align: center; }
.form-group label, .login-card h2 { color: var(--text-primary); font-weight:600;}
.form-group input, .form-group textarea, .form-group select { background-color: #374151; border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 8px; padding: 12px 15px; font-size: 1em; width: 100%; box-sizing: border-box; margin-top: 8px; }
.form-help-text { font-size: 0.85em; color: var(--text-secondary); margin-top: 5px; text-align: left; }
.submit-form-button { background: var(--primary-color); color: white; border:none; padding:12px; border-radius:8px; font-size:1em; font-weight:bold; cursor:pointer; width:100%;}
footer { background-color: #111827; color: var(--text-secondary); padding: 60px 0 20px 0; }
.footer-column h4 { color: #ffffff; }
.footer-column ul li a { color: var(--text-secondary); }
.footer-column ul li a:hover { color: #ffffff; }
.footer-bottom { border-top: 1px solid #374151; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; margin-bottom: 40px; }
.fixed-search-bar { position: fixed; bottom: 0; left: 0; width: 100%; background-color: rgba(31, 41, 55, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 15px 0; border-top: 1px solid var(--border-color); z-index: 999; }
.fixed-search-bar form { max-width: 700px; margin: 0 auto; display: flex; }
.fixed-search-bar input[type="text"] { flex-grow: 1; border: 1px solid #4B5563; border-right: none; padding: 12px 20px; font-size: 1em; border-radius: 50px 0 0 50px; outline: none; background-color: #374151; color: var(--text-primary); }
.fixed-search-bar button { border: none; background: var(--gradient-text); color: white; padding: 0 30px; font-size: 1em; font-weight: bold; cursor: pointer; border-radius: 0 50px 50px 0; }

/* === MOBILE RESPONSIVENESS === */
@media screen and (max-width: 768px) {
  body {
    overflow-x: hidden;
  }
}

/* This controls the space ABOVE the recommended tools */
.recommended-tools {
    padding-top: 5px; /* Change this number. Smaller number = less space. */
}

/* === START: RESPONSIVE code for Recommended Tools === */
/* This new code replaces the previous block for Recommended Tools. */
/* It provides a mobile-friendly grid and a horizontal row for desktops. */

/* --- Default style for Mobile (phones) --- */
.recommended-tools .tools-grid {
    display: grid;
    /* This creates a grid that automatically fits as many columns as possible */
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 25px;
    padding: 10px;
}

/* --- Style for Tablet and Desktop screens --- */
@media (min-width: 768px) {
    .recommended-tools .tools-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto; /* The "dragger" will now only appear on larger screens */
        gap: 30px;
        padding: 15px 5px;
    }
}

/* Styles for each individual tool (these apply to all screen sizes) */
.recommended-tools .tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    text-decoration: none;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    padding: 0;
    min-height: auto;
}

.recommended-tools .tool-card:hover {
    transform: translateY(-3px);
    box-shadow: none;
}
/* === END: RESPONSIVE code === */
/* === START: Fix to hide unnecessary scrollbar on desktop === */

/* This hides the scrollbar for Chrome, Safari, and Edge */
.recommended-tools .tools-grid::-webkit-scrollbar {
    display: none;
}

/* This hides the scrollbar for Firefox */
.recommended-tools .tools-grid {
  scrollbar-width: none;
}

/* === END: Fix to hide unnecessary scrollbar === */
/* ---------- Quick surgical fixes for Recommended Tools layout ---------- */

/* 1) Make the Recommended Tools container compact and use a simple inline grid */
.recommended-tools .tools-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 18px !important;
  padding: 0 12px !important;
  margin: 0 auto 10px auto !important;
  align-items: flex-start !important;
}

/* 2) Remove big card footprint for recommended tools (not just invisible) */
.recommended-tools .tool-card {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 8px !important;
  min-height: 0 !important;
  height: auto !important;
  width: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

/* 3) Force logos to fixed reasonable size (prevent huge/zero sizes) */
.recommended-tools .tool-logo,
.recommended-tools img.tool-logo {
  display: block !important;
  width: 56px !important;
  height: 56px !important;
  object-fit: contain !important;
  margin: 0 auto 6px auto !important;
  padding: 4px !important;
  background: rgba(255,255,255,0.02) !important;
  border-radius: 8px !important;
}

/* 4) Tool name styling */
.recommended-tools .tool-name {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: inherit !important;
}

/* 5) Collapse hero excessive height / pseudo-elements that create big blank bands */
/* Target common hero classes and any pseudo-element watermarks */
.hero, .main-title-section, .page-hero, .hero-section, .hero-wrap {
  min-height: 0 !important;
  padding-top: 12px !important;
  padding-bottom: 8px !important;
  margin: 0 !important;
  overflow: visible !important;
}
.hero::before, .hero::after, .main-title-section::before, .main-title-section::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

/* 6) Remove large decorative watermark elements (common classnames) */
.hero .watermark, .site-watermark, .hero .bg-letter, .big-letter, .hero-watermark {
  display: none !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
}

/* 7) Last-resort: if a container has an enormous fixed height, shrink it */
.header, .site-header, .page, .content-area {
  min-height: 0 !important;
}

/* 8) Minor responsive adjustments */
@media (max-width: 768px) {
  .recommended-tools .tool-logo { width: 48px !important; height: 48px !important; }
  .recommended-tools .tools-grid { gap: 10px !important; }
}
