:root {
    --primary: #0066FF;
    --primary-hover: #0052CC;
    --success: #00B074;
    --bg: #F4F6F9;
    --card-bg: #FFFFFF;
    --text: #1A1D20;
    --text-muted: #6C7A89;
    --border: #E9ECEF;
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   Header & Navigation (Optimized for Vertical Alignment & Logo Kerning)
   ========================================================================== */
.main-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center; /* Ensures vertical alignment center across left & right wrappers */
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    letter-spacing: -0.6px; /* Modern tight dashboard typography */
    line-height: 1;
}

.logo span {
    color: var(--primary);
    margin-left: -2px; /* Pulls the blue accent dot perfectly flush against the character l */
}

.nav-links {
    display: flex;
    align-items: center; /* Fixes right-side text riding high */
    gap: 20px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* ==========================================================================
   Hero Section 
   ========================================================================== */
.hero {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 60px 20px;
    text-align: center;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.search-wrapper {
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

/* ==========================================================================
   Main Layout Grid
   ========================================================================== */
.main-content {
    max-width: var(--max-width);
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    flex-grow: 1;
}

.category-section {
    margin-bottom: 50px;
}

.category-header {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tools-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 24px !important;
    width: 100% !important;
    margin-bottom: 40px;
}

/* ==========================================================================
   Tool Cards
   ========================================================================== */
.tool-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
}

.tool-icon {
    font-size: 1.8rem;
    margin-bottom: 14px;
    background-color: #F0F5FF;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.tool-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ==========================================================================
   Search Validation Feedback Block
   ========================================================================== */
.search-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    width: 100%;
}

.search-no-results h3 {
    color: var(--text);
    font-size: 1.3rem;
    margin-bottom: 8px;
    font-weight: 700;
}

/* ==========================================================================
   Footer Styling
   ========================================================================== */
.main-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 30px 20px;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Mobile Responsiveness Overrides
   ========================================================================== */
@media (max-width: 768px) {
    .hero { padding: 40px 20px; }
    .hero h1 { font-size: 1.8rem; }
    .tools-grid { grid-template-columns: 1fr; }
    .nav-container { flex-direction: column; gap: 15px; text-align: center; }
}

/* ==========================================
   Tool Page Layout & Functional Styling
   ========================================== */
.tool-layout-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.tool-main-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
}

.tool-sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Reusable Interactive UI Elements */
.tool-textarea {
    width: 100%;
    height: 220px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
    margin-bottom: 15px;
}

.tool-textarea:focus {
    border-color: var(--primary);
}

.tool-btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.btn-tool {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-tool:active {
    transform: scale(0.98);
}

.btn-primary-tool {
    background-color: var(--primary);
    color: white;
}

.btn-primary-tool:hover {
    background-color: var(--primary-hover);
}

.btn-secondary-tool {
    background-color: #E9ECEF;
    color: var(--text);
}

.btn-secondary-tool:hover {
    background-color: #DDE2E5;
}

/* Results Area */
.tool-results-box {
    background-color: #F8F9FA;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

/* Monetized Ad Placeholder Blocks */
.ad-slot-horizontal {
    background: #EAEFF5;
    border: 2px dashed #CBD5E1;
    border-radius: 8px;
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 30px;
}

.ad-slot-sidebar {
    background: #EAEFF5;
    border: 2px dashed #CBD5E1;
    border-radius: 8px;
    text-align: center;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 992px) {
    .tool-layout-container {
        grid-template-columns: 1fr;
    }
}