/* ==========  Design Tokens  ========== */
:root {
    /* Colors */
    --primary: #FF6B6B;            /* Coral */
    --primary-dark: #E63946;       /* Darker coral */
    --secondary: #1f73ba;          /* Aqua */
    --secondary-dark: #1f4785;     /* Darker aqua */

    /* Typography */
    --font-family-base: 'Inter', sans-serif;
    --font-size-base: 16px;
    --font-size-small: 0.85rem;
    --font-size-large: 1.25rem;
    --font-size-xl: 2rem;
    --line-height-base: 1.5;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==========  Base Reset & Typography  ========== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    background: #f9fafb;
    color: #333;
}

body {
    display: flex;
    flex-direction: column;
}

h1 {
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

/* ==========  Header  ========== */
.utils-hub {
    line-height: 0!important;
}

header {
    background: white;
    color: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--secondary);
    font-weight: 600;
}

.header-logo img { width: 40px; height: 40px; }

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header-right input,
.header-right select {
    padding: var(--space-sm);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* ==========  Hero  ========== */
.hero {
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: var(--space-lg) var(--space-md);
}

.hero h2 {
    margin: 0 0 var(--space-sm);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.hero p {
    opacity: 0.9;
    font-size: 1rem;
}

/* ==========  Categories  ========== */
.category-tabs {
    display: flex;
    overflow-x: auto;
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
    background: white;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.category-tabs::-webkit-scrollbar { height: 6px; }
.category-tabs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 20px; }

.category-tabs button {
    background: #f1f5f9;
    border: none;
    border-radius: 20px;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-small);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-tabs button.active { background: var(--primary); color: white; }
.category-tabs button:hover:not(.active) { background: var(--secondary); color: white; }

/* ==========  Main Content  ========== */
main {
    flex: 1;
    max-width: 1200px;
    margin: auto;
    padding: var(--space-lg) var(--space-md);
}

/* Tools Grid: exactly 3 columns on desktop */
.tools-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .tools-grid { grid-template-columns: 1fr; }
}

/* Tool Card */
.tool-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.tool-title {
    font-weight: 600;
    color: var(--primary);
}

.tool-desc {
    flex: 1;
    font-size: var(--font-size-small);
    color: #555;
    margin: var(--space-sm) 0 var(--space-md);
}

.tool-card a {
    background: var(--secondary);
    color: white;
    padding: var(--space-sm);
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-small);
    font-weight: 500;
    cursor: pointer;
}

.tool-card a:hover { background: var(--secondary-dark); }

/* ==========  Footer Sticky  ========== */
footer {
    background: var(--secondary);
    color: white;
    padding: var(--space-md);
    text-align: center;
    font-size: var(--font-size-small);
    margin-top: auto;
}

footer a {
    color: white;
    margin: 0 var(--space-xs);
    font-weight: 500;
}

footer a:hover { text-decoration: underline; }

/* ==========  Responsive tweaks ========== */
@media(max-width:600px){
    .header-inner { flex-direction: column; align-items: flex-start; }
    .header-right { width: 100%; flex-wrap: wrap; }
    .header-right input, .header-right select { flex: 1; width: 100%; }
}
