:root {
    --primary-color: #0A2A43;
    /* Dark Blue */
    --secondary-color: #1FBF75;
    /* Green */
    --background-color: #F5F7FA;
    /* Light Grey */
    --text-color: #333333;
    --white: #FFFFFF;
    --border-color: #E0E0E0;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 16px;
    /* Space between burger and logo */
    color: #1a1a1a;
    /* Darker black for visibility */
    transition: color 0.2s;
}

.mobile-menu-btn:hover {
    color: var(--primary-color);
}

/* SVG Icon Thicker */
.mobile-menu-btn svg {
    width: 32px;
    height: 32px;
    stroke-width: 3px;
    /* Thicker lines */
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    /* Use percentage for full hiding */
    width: 300px;
    height: 100vh;
    background: #ffffff;
    /* Solid white */
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    /* Max Z-index */
    transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    left: 0;
}

/* Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99990;
    /* Just below sidebar */
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

.side-line-hide {
    display: none !important;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1rem;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}

.sidebar-close:hover {
    color: #ef4444;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 1.05rem;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.sidebar-links a:hover {
    background: #f8fafc;
    color: var(--primary-color);
}

.sidebar-links a.active-link {
    background: #e0f2fe;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Ensure Header Alignment */
    .navbar {
        display: flex !important;
        /* Force flex on mobile */
        justify-content: space-between;
        padding: 0 10px;
    }
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    position: relative;
    z-index: 101;
}

.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.nav-left {
    justify-self: start;
}

.nav-center {
    justify-self: center;
}

.nav-right {
    justify-self: end;
    display: flex;
    gap: 15px;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

/* Middle Links */
.nav-center a {
    color: #333;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
}

.nav-center a:hover {
    color: var(--primary-color);
}

/* Right Auth Links */
.nav-right a {
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.nav-right a:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .navbar {
        display: flex;
        justify-content: space-between;
    }

    .nav-center {
        display: none;
    }

    /* Hide center links on mobile if needed, or adjust */
}

.nav-btn-signup {
    background-color: var(--secondary-color);
    color: white !important;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-btn-signup:hover {
    background-color: #16a362;
}

@media (max-width: 900px) {
    .nav-links {
        gap: 10px;
    }

    .hide-mobile {
        display: none;
    }

    .logo {
        font-size: 1.2rem;
    }
}

/* --- Dashboard Homepage (iLovePDF Style) --- */

.hero-dashboard {
    padding: 4rem 0 3rem 0;
    text-align: center;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.hero-dashboard h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #1E293B;
    letter-spacing: -0.5px;
}

.hero-dashboard p {
    font-size: 1.2rem;
    color: #64748B;
    font-weight: 300;
    max-width: 700px;
    margin: 0 auto;
}

.highlight-blue {
    color: var(--primary-color);
    font-weight: 700;
}

/* Filter Tabs */
.filter-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: var(--font-family);
}

.filter-btn:hover {
    background: #e2e8f0;
    color: #333;
}

.filter-btn.active {
    background: #333;
    color: white;
}

/* Dashboard Grid */
.dashboard-padding {
    padding-bottom: 4rem;
    min-height: 60vh;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    column-gap: 2rem;
    /* Much larger horizontal gap */
    row-gap: 3rem;
    /* Huge vertical gap */
}

/* Force 4 Columns on Desktop */
@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
        column-gap: 3rem;
        /* Even larger gap on big screens to squeeze cards */
    }
}

.tool-card-dashboard {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.8rem;
    /* Ultra compact padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
    height: 100%;
}

.tool-card-dashboard:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    border-color: var(--secondary-color);
    /* Highlight border on hover */
}

.tool-icon {
    width: 36px;
    /* Miniature Icon */
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    color: white;
}

.tool-icon svg {
    width: 20px;
    height: 20px;
}

/* Icon Colors */
.icon-red {
    background-color: #EF4444;
}

.icon-blue {
    background-color: #3B82F6;
}

.icon-purple {
    background-color: #8B5CF6;
}

.icon-grey {
    background-color: #94A3B8;
}

.tool-card-dashboard h3 {
    font-size: 0.9rem;
    /* Small Title */
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 0.2rem;
}

.tool-card-dashboard p {
    font-size: 0.75rem;
    /* Micro Description */
    color: #64748B;
    line-height: 1.25;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Badges */
.coming-soon {
    opacity: 0.6;
    pointer-events: none;
    background: #F8FAFC;
}

.badge-soon {
    margin-top: auto;
    padding: 3px 8px;
    background: #E2E8F0;
    color: #64748B;
    font-size: 0.7rem;
    border-radius: 4px;
    display: inline-block;
    margin-top: 12px;
    font-weight: 600;
}

/* Footer & Extras */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

footer a {
    color: #ddd;
    margin: 0 10px;
    font-size: 0.9rem;
}

/* Keep styles for PDF Preview / legacy compatibility just in case */
#pdf-preview {
    margin-top: 2rem;
    background: white;
}

@media print {
    body * {
        visibility: hidden;
    }

    #pdf-preview,
    #pdf-preview * {
        visibility: visible;
    }

    #pdf-preview {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20mm !important;
    }
}

/* Mobile 3-Column Grid Override */
@media (max-width: 640px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .tool-card-dashboard {
        padding: 0.75rem 0.25rem;
        min-height: auto;
    }

    .tool-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }

    .tool-icon svg {
        width: 20px;
        height: 20px;
    }

    .tool-card-dashboard h3 {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
        line-height: 1.2;
    }

    .tool-card-dashboard p {
        display: none;
        /* Hide descriptions on mobile for cleaner grid */
    }

    .badge-soon {
        font-size: 0.5rem;
        padding: 2px 4px;
        margin-top: 4px;
    }
}