@import url("./tool-common.css");

:root {
    --bg: #f5f7f8;
    --bg-soft: #f8fafc;
    --surface: #ffffff;
    --text: #14232e;
    --muted: #4d6370;
    --text-muted: #64748b;
    --line: #d7e0e6;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --footer-bg: #151a2a;
    --footer-text: #e9eef2;
    --footer-muted: #b9c2cf;
    --border-light: #e2e8f0;
    --danger: #dc2626;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* ---------- HEADER ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 16px;
}

.brand {
    color: var(--brand-dark);
    text-decoration: none;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.main-nav {
    flex: 1;
}

.main-nav-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-item {
    position: relative;
}

.menu-button {
    border: none;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-block;
}

.menu-button:hover,
.menu-item:focus-within .menu-button {
    background: #eaf1f6;
}

/* ---------- DROPDOWN ---------- */

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 420px;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
}

.menu-item:hover .dropdown {
    display: grid;
}

.dropdown-subcategory {
    display: flex;
    flex-direction: column;
}

.dropdown-subtitle {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--brand-dark);
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
}

.dropdown a {
    padding: 4px 0;
    font-size: 14px;
    color: #333;
    text-decoration: none;
}

.dropdown a:hover {
    color: var(--brand-dark);
}

/* ---------- HEADER ---------- */

.menu-button,
.header-link {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    padding: 10px 12px;
    border-radius: 8px;

}

.header-link:hover {
    background: #eaf1f6;
}

/* ---------- FOOTER ---------- */

.site-footer {
    margin-top: 42px;
    background: var(--footer-bg);
    color: var(--footer-text);
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 34px 16px 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    gap: 20px;
}

.footer-group h3 {
    margin: 0 0 12px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.footer-group a {
    display: block;
    color: var(--footer-muted);
    text-decoration: none;
    margin: 8px 0;
}

.footer-group a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 18px;
    padding-top: 14px;
    color: var(--footer-muted);
    font-size: 13px;
}

.footer-subcategory {
    margin-bottom: 10px;
}

.footer-subtitle {
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
    color: #ffffff;
    opacity: 0.85;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 980px) {
    .site-header-inner {
        flex-wrap: wrap;
    }

    .main-nav {
        width: 100%;
        overflow-x: auto;
    }

    .main-nav-list {
        min-width: 760px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 680px) {
    .brand {
        font-size: 26px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- HERO SECTION ---------- */

.hero {
    margin-bottom: 24px;
    padding: 18px 16px;
    border-radius: 12px;
    background: #16324f;
    color: #f5f7f8;
}

.hero h1 {
    margin: 0 0 6px;
}

.hero p {
    margin: 0;
}

/* ---------- HEADING SECTION ---------- */

.main-container {
    max-width: 1100px;
    margin: 0 auto 0;
    padding: 24px 16px 48px;
}

/* ---------- SHARED CONTAINER (from global.css) ---------- */
.hub {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}

/* ---------- CARDS (from global.css) ---------- */
.card {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    margin-bottom: 24px;
}

/* ---------- TABLES (from global.css) ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}

th {
    background: var(--bg-soft);
    font-weight: 600;
}

/* ---------- PAGINATION (from global.css) ---------- */
.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.pagination button {
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

/* ---------- PILLS (from global.css) ---------- */
.pill {
    display: inline-block;
    background: var(--bg-soft);
    padding: 4px 10px;
    border-radius: 12px;
    margin-right: 6px;
    font-size: 13px;
}

/* ---------- CATEGORY SECTION ---------- */

.category {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #d7ddd9;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.category h2 {
    margin: 0 0 6px;
}

.category h3 {
    margin: 16px 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #1f3b57;
}

.category p {
    margin: 0 0 14px;
    color: var(--muted);
}

.category ul {
    margin: 0;
    padding-left: 18px;
    column-count: 2;
    column-gap: 24px;
}

.category li {
    margin-bottom: 8px;
    break-inside: avoid;
}

.category a {
    color: #0f4c7f;
    text-decoration: none;
}

.category-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.category-cta {
    font-weight: 600;
    text-decoration: none;
    color: var(--brand-dark);
    transition: opacity 0.2s ease;
}

.category-cta:hover {
    opacity: 0.75;
}

@media (max-width: 720px) {
    .category ul {
        column-count: 1;
    }
}

/* ---------- SUB CATEGORY ---------- */
.subcategory {
    margin-bottom: 1rem;
}

.subcategory:last-child {
    margin-bottom: 0;
}

.subcategory h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 14px;
}

.subcategory h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 4px;
    height: 18px;
    background: #2563eb;
    border-radius: 2px;
}

.subcategory ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem 1.5rem;
}

/* Make the entire card clickable */
.subcategory li {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0;
    /* Remove padding from li */
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

/* Link fills the entire card */
.subcategory li a {
    display: block;
    padding: 1rem 1.2rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
    width: 100%;
    height: 100%;
}

/* Hover effects */
.subcategory li:hover {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.subcategory li a:hover {
    color: #2563eb;
    text-decoration: none;
    /* Ensure no underline */
}

/* Remove any global link underlines */
.category a:hover,
.subcategory a:hover {
    text-decoration: none;
}

/* ---------- SEARCH ---------- */

.tools-search {
    margin: 16px 0 24px;
}

.tools-search input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    font-size: 15px;
}

.no-results {
    margin: 24px 0;
    padding: 16px;
    border-radius: 8px;
    background: #f5f7fa;
    text-align: center;
    font-weight: 600;
    color: var(--brand-dark);
}

/* ---------- HOME PAGE HERO ---------- */
.home-page .hero {
    text-align: center;
    padding: 48px 24px;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #1a3650 0%, #2a4a6e 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.home-page .hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.home-page .hero p {
    font-size: 1.5rem;
    opacity: 0.95;
    margin: 0;
    font-weight: 400;
}

@media (max-width: 768px) {
    .home-page .hero h1 {
        font-size: 3rem;
    }

    .home-page .hero p {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .home-page .hero {
        padding: 32px 16px;
    }

    .home-page .hero h1 {
        font-size: 2.5rem;
    }
}

/* ---------- FEATURED TOOLS SECTION (Homepage) ---------- */
.home-page .category {
    margin-top: 32px;
}

.home-page .category h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
}

.home-page .category h2:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: var(--brand);
    border-radius: 2px;
}

/* Featured tools cards - match subcategory styling */
.home-page .subcategory ul {
    grid-template-columns: repeat(3, 1fr);
}

.home-page .subcategory li {
    padding: 0;
}

.home-page .subcategory li a {
    display: block;
    padding: 1rem 1.2rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
}

.home-page .subcategory li:hover {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.home-page .subcategory li a:hover {
    color: #2563eb;
    text-decoration: none;
}

/* Responsive for featured grid */
@media (max-width: 640px) {

    .subcategory ul,
    .home-page .subcategory ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {

    .subcategory ul,
    .home-page .subcategory ul {
        grid-template-columns: 1fr;
    }
}

/* ---------- TOOL INFO SECTION ---------- */
.info-section {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin: 48px auto 0;
    padding: 24px;
    max-width: 1000px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

.info-section h3 {
    margin: 0 0 16px 0;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 600;
}

.info-section p {
    color: var(--text-muted);
    margin: 0 0 20px 0;
    line-height: 1.6;
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.info-links {
    color: var(--text-muted);
    font-size: 0.95rem;
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
}

.info-links li {
    margin-bottom: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.info-links a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.info-links a:hover {
    text-decoration: underline;
}

.info-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.info-pill {
    background: var(--bg-soft);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--border-light);
}

/* Legal pages (Privacy Policy, Terms) */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px 48px;
    background: var(--surface);
    border-radius: 12px;
}

.legal-content section {
    margin-bottom: 32px;
}

.legal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--text);
}

.legal-content p {
    line-height: 1.6;
    margin-bottom: 16px;
    color: var(--text);
}

.legal-content ul {
    margin: 16px 0;
    padding-left: 24px;
}

.legal-content li {
    margin: 8px 0;
    line-height: 1.5;
}
