/* =========================================
   1. GLOBAL RESET & BRANDING
   ========================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

a { text-decoration: none; color: #007bff; transition: color 0.2s; }
a:hover { color: #0056b3; }

h1, h2, h3 { margin-top: 0; color: #333; }

/* =========================================
   2. NAVIGATION BAR
   ========================================= */
nav {
    background: white;
    padding: 1rem 5%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-link {
    font-weight: bold;
    font-size: 1.5rem;
    color: #333;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover { color: #007bff; }

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #333;
}

/* =========================================
   3. DROPDOWN MENU STYLES
   ========================================= */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: transparent;
    color: #555;
    padding: 10px 0;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.dropbtn:hover { color: #007bff; }

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1001;
    border-radius: 8px;
    border: 1px solid #eee;
    top: 100%;
    left: -20px;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #f9f9f9;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* Show Menu on Hover (Desktop) */
.dropdown:hover .dropdown-content {
    display: block;
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 { color: white; font-size: 2.5rem; margin-bottom: 10px; }
.hero p { font-size: 1.2rem; opacity: 0.9; color: rgba(255,255,255,0.9); }

/* =========================================
   5. LAYOUT CONTAINERS
   ========================================= */
.container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

/* Dashboard Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Tool Cards */
.tool-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    display: block;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
    border-color: #007bff;
}

.tool-card h3 { color: #007bff; margin-bottom: 10px; }
.tool-card p { color: #666; margin: 0; }
.icon { font-size: 2rem; display: block; margin-bottom: 15px; }
.badge { background: #d4edda; color: #155724; padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: bold; float: right; }

/* =========================================
   6. FORMS & CONTROLS
   ========================================= */
.controls {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

h2 { font-size: 1.2rem; border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; margin-bottom: 20px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }

label { display: block; margin-bottom: 8px; font-weight: 600; color: #555; font-size: 0.9rem; }

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: inherit;
    transition: border 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: #007bff;
    outline: none;
}

textarea { resize: vertical; }
hr { border: 0; border-top: 1px solid #eee; margin: 25px 0; }

/* Line Items */
.line-item-header { display: grid; grid-template-columns: 3fr 1fr 1fr 30px; gap: 10px; margin-bottom: 5px; padding: 0 5px; }
.line-item-header label { font-size: 0.75rem; text-transform: uppercase; color: #888; }
.line-item { display: grid; grid-template-columns: 3fr 1fr 1fr 30px; gap: 10px; align-items: center; margin-bottom: 10px; }
.remove-btn { background: #dc3545; color: white; border: none; width: 30px; height: 38px; border-radius: 6px; cursor: pointer; }

/* Action Buttons */
.btn-secondary {
    background: #6c757d; color: white; border: none; padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: 600;
}
.btn-primary {
    width: 100%;
    background-color: #28a745;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}
.btn-primary:hover { background-color: #218838; }

/* =========================================
   7. PREVIEW AREA (The Paper)
   ========================================= */
.preview-area { display: flex; justify-content: center; }
#paper-preview {
    background: white;
    width: 100%;
    min-height: 600px;
    padding: 40px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-radius: 4px;
    font-size: 12px;
}
.header-row { display: flex; justify-content: space-between; margin-bottom: 30px; }
.col-left, .col-mid, .col-right { width: 30%; }
.col-mid { text-align: center; } .col-right { text-align: right; }
.preview-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.preview-table th { text-align: left; border-bottom: 2px solid #333; padding: 8px 5px; }
.preview-table td { border-bottom: 1px solid #eee; padding: 10px 5px; }

/* Pie Chart (Tax Tool) */
.pie-chart {
    width: 150px; height: 150px; border-radius: 50%;
    background: conic-gradient(#007bff var(--p), #eee 0);
    margin: 0 auto 20px auto;
    transition: --p 0.5s;
}

/* =========================================
   8. ADSENSE & FOOTER
   ========================================= */
.ad-slot {
    width: 100%;
    max-width: 1000px;
    min-height: 280px;
    background: #f9f9f9;
    margin: 60px auto 40px auto;
    
    /* HIDE FOR NOW (Change to 'flex' later) */
    display: none; 
    align-items: center;
    justify-content: center;
}

/* Back Link */
.back-link-wrapper { grid-column: 1 / -1; margin-bottom: -10px; }
.back-link { font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }

/* Install Guide Box */
.install-guide {
    background: #e9f5ff;
    border-left: 5px solid #007bff;
    border-radius: 8px;
    padding: 25px;
    margin: 40px auto;
    max-width: 600px;
    color: #333;
}
.install-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 15px; }
.step-card { background: white; padding: 15px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

footer {
    text-align: center; padding: 40px; background: #333; color: #ccc; margin-top: 60px;
}

/* =========================================
   9. MOBILE RESPONSIVENESS
   ========================================= */
@media print { .ad-slot, nav, .back-link-wrapper, .install-guide, .btn-primary, .btn-secondary { display: none !important; } }

@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
    .preview-area { display: none; }
    
    .menu-toggle { display: block; }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
    }
    
    .nav-links.active { display: flex; }
    
    .nav-links a {
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
        box-sizing: border-box;
    }

    /* Mobile Dropdown Fix */
    .dropdown { width: 100%; }
    
    .dropbtn {
        width: 100%;
        text-align: left;
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
        font-weight: bold;
    }
    
    .dropdown-content {
        display: block;
        position: relative;
        box-shadow: none;
        border: none;
        background: #fafafa;
        top: 0;
        left: 0;
    }
    
    .dropdown-content a {
        padding-left: 40px;
        font-size: 0.9rem;
    }

    .install-steps { grid-template-columns: 1fr; }
    .hero { padding: 40px 15px; }
    .hero h1 { font-size: 1.8rem; }
}

/* =========================================
   10. SEO CONTENT SECTIONS
   ========================================= */
.seo-content {
    background: white;
    padding: 40px;
    margin: 40px auto;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    color: #444;
}

.seo-content h2 { color: #007bff; font-size: 1.5rem; margin-top: 30px; }
.seo-content p { line-height: 1.8; margin-bottom: 15px; font-size: 1rem; }
.seo-content ul { line-height: 1.8; margin-bottom: 20px; }
.seo-content li { margin-bottom: 10px; }
