/* style.css - Complete Styling with Full Responsive Design */
:root {
    --primary: #6366F1;
    --primary-dark: #4F52E0;
    --secondary: #8B5CF6;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================= */
/* TYPOGRAPHY */
/* ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================= */
/* NAVIGATION - Fully Responsive */
/* ========================================= */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    flex-wrap: wrap;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.nav-brand i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-cta {
    display: flex;
    align-items: center;
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    border-radius: var(--radius-2xl);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
    white-space: nowrap;
}

.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================= */
/* HERO SECTION - Responsive */
/* ========================================= */
.hero-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, white, var(--background));
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    margin-bottom: 2rem;
}

.badge-pill {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: var(--radius-2xl);
    font-weight: 600;
    font-size: 0.9rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================= */
/* AD PLACEHOLDERS - Responsive */
/* ========================================= */
.ad-banner {
    margin: 2rem auto;
}

.ad-placeholder {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    border: 2px dashed var(--border);
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem !important;
}

.ad-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    to {
        left: 100%;
    }
}

.ad-placeholder span {
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.ad-placeholder.vertical {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-sidebar {
    margin-bottom: 2rem;
}

/* ========================================= */
/* TOOL SECTION - FULLY RESPONSIVE */
/* ========================================= */
.tool-section {
    padding: 4rem 0;
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* MAIN GRID */
.tool-grid {
    display: grid;
    grid-template-columns: 70% 28%;
    gap: 2%;
    align-items: start;
}

/* Form Styling */
.form-wrapper {
    width: 100%;

}

.form-card {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    border: 1px solid var(--border);
}

.form-block {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.form-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.block-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.block-header i {
    font-size: 1.25rem;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
}

.block-header h3 {
    font-size: 1.1rem;
    flex: 1;
    color: var(--text-primary);
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.required {
    color: #ef4444;
}

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: 0.95rem;
    transition: all 0.2s;
    background: white;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* File Input */
.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-input-btn {
    padding: 0.75rem 1rem;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-xl);
    text-align: center;
    color: var(--text-muted);
    background: var(--background);
    transition: all 0.2s;
    position: relative;
    z-index: 1;
}

.file-input-wrapper:hover .file-input-btn {
    border-color: var(--primary);
    color: var(--primary);
}

.logo-preview {
    margin-top: 10px;
    max-width: 100px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.logo-preview img {
    width: 100%;
    height: auto;
}

/* ========================================= */
/* COLOR THEME SELECTION - Responsive */
/* ========================================= */
.color-theme-container {
    background: var(--background);
    border-radius: var(--radius-xl);
    padding: 1rem;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
}

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    min-width: 60px;
}

.color-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.color-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-bottom: 0.25rem;
    border: 2px solid transparent;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.color-option input[type="radio"]:checked+.color-circle {
    border-color: #333;
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.color-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.custom-color {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.custom-color label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.custom-color-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.custom-color-input input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    padding: 2px;
}

.custom-color-input input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-family: monospace;
}

.custom-color-input input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========================================= */
/* ITEMS TABLE - Fully Responsive */
/* ========================================= */
.items-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-top: 15px;
    -webkit-overflow-scrolling: touch;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.items-table th {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid var(--primary);
    white-space: nowrap;
}

.items-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.items-table input {
    width: 100%;
    padding: 6px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    box-sizing: border-box;
}

.items-table input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.item-line-total {
    display: block;
    font-weight: 600;
    color: var(--primary);
    text-align: right;
    font-size: 0.85rem;
    white-space: nowrap;
}

.remove-item {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item:hover {
    background: #fee2e2;
    transform: scale(1.05);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-2xl);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================= */
/* FORM ACTIONS - Responsive */
/* ========================================= */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-2xl);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1 1 auto;
    min-width: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ========================================= */
/* PREVIEW SIDEBAR */
/* ========================================= */
.preview-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.preview-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    position: sticky;
    top: 100px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid var(--border);
}

.preview-header i {
    color: var(--primary);
}

.preview-header h3 {
    flex: 1;
    font-size: 1rem;
}

.live-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-2xl);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Live Preview */
.invoice-preview {
    padding: 12px;
    max-height: 600px;
    overflow-y: auto;
    background: white;
    font-family: 'Helvetica', 'Arial', sans-serif;
    -webkit-overflow-scrolling: touch;
}

.invoice-preview .preview-invoice {
    font-size: 11px;
    line-height: 1.4;
    color: #1f2937;
}

.invoice-preview .company-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 3px;
    word-wrap: break-word;
}

.invoice-preview .company-details {
    font-size: 10px;
    color: #4b5563;
    line-height: 1.3;
    word-wrap: break-word;
}

.invoice-preview .invoice-title {
    font-size: 24px;
    font-weight: 800;
    text-align: right;
    letter-spacing: -0.5px;
}

.invoice-preview .section-heading {
    font-size: 12px;
    font-weight: 600;
    margin: 8px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-preview .details-box {
    background: #f9fafb;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 10px;
}

.invoice-preview .details-box>div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.invoice-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 10px;
}

.invoice-preview th {
    background: var(--preview-primary, #4f46e5);
    color: white;
    padding: 6px 4px;
    font-weight: 600;
    font-size: 10px;
    text-align: left;
    white-space: nowrap;
}

.invoice-preview td {
    padding: 6px 4px;
    border-bottom: 1px solid #e5e7eb;
    word-wrap: break-word;
}

.invoice-preview .totals {
    text-align: right;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 11px;
}

.invoice-preview .grand-total {
    font-size: 14px;
    font-weight: bold;
    border-top: 2px solid var(--preview-primary, #4f46e5);
    padding-top: 6px;
    margin-top: 6px;
    color: var(--preview-primary, #4f46e5);
}

.invoice-preview .payment-info {
    background: #f9fafb;
    padding: 8px;
    border-radius: 6px;
    margin: 8px 0;
    font-size: 10px;
    word-wrap: break-word;
}

.invoice-preview .notes-section {
    font-size: 10px;
    color: #4b5563;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d1d5db;
    word-wrap: break-word;
}

/* ========================================= */
/* FEATURES SECTION - Responsive Grid */
/* ========================================= */
.features-section {
    padding: 5rem 0;
    background: var(--background);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
}

.feature-card h4 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================= */
/* FOOTER - Responsive Grid */
/* ========================================= */
.site-footer {
    background: var(--text-primary);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.footer-logo i {
    color: var(--secondary);
}

.footer-about p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: white;
    transition: all 0.2s;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-links h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.newsletter-form input {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.newsletter-form input::placeholder {
    color: #64748b;
}

.newsletter-form button {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: var(--radius-xl);
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    white-space: nowrap;
}

.newsletter-form button:hover {
    transform: scale(1.05);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

/* ========================================= */
/* RESPONSIVE BREAKPOINTS */
/* ========================================= */

/* Large Desktop (up to 1400px) */
@media (max-width: 1400px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-title {
        font-size: 3.2rem;
    }
}

/* Desktop (up to 1200px) */
@media (max-width: 1200px) {
    .tool-grid {
        grid-template-columns: 65% 33%;
        gap: 2%;
    }

    .hero-title {
        font-size: 3rem;
    }

    .form-card {
        padding: 1.75rem;
    }

    .features-grid {
        gap: 1.5rem;
    }
}

/* Tablet Landscape (up to 992px) */
@media (max-width: 992px) {
    .tool-grid {
        display: block;
        gap: 2rem;
    }

    .preview-sidebar {
        max-width: 100%;
        margin: 0;
        width: 100%;
    }

    .preview-card {
        position: static;
        width: 100%;
    }

    .form-wrapper {
        max-width: 100%;
        overflow: hidden !important;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-stats {
        gap: 2rem;
    }

    .navbar {
        height: auto;
        padding: 1rem 0;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }
}

/* Tablet Portrait (up to 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .tool-section {
        padding: 2rem 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .section-header p {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .form-card {
        padding: 1.25rem;
        border-radius: var(--radius-xl);
    }

    .form-block {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .block-header {
        margin-bottom: 1rem;
    }

    .block-header i {
        font-size: 1rem;
        padding: 0.4rem;
    }

    .block-header h3 {
        font-size: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .field-group {
        gap: 0.25rem;
    }

    .field-group label {
        font-size: 0.75rem;
    }

    .field-group input,
    .field-group select,
    .field-group textarea {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
        border-radius: var(--radius-lg);
    }

    .file-input-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .logo-preview {
        max-width: 80px;
    }

    .color-theme-container {
        padding: 0.75rem;
    }

    .color-options {
        gap: 0.5rem;
        justify-content: center;
    }

    .color-option {
        min-width: 50px;
        padding: 0.25rem;
    }

    .color-circle {
        width: 28px;
        height: 28px;
    }

    .color-name {
        font-size: 0.6rem;
    }

    .custom-color {
        padding-top: 1rem;
    }

    .custom-color label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .custom-color-input {
        flex-direction: column;
        gap: 0.5rem;
    }

    .custom-color-input input[type="color"] {
        width: 100%;
        height: 44px;
    }

    .custom-color-input input[type="text"] {
        width: 100%;
        padding: 0.6rem 0.75rem;
    }

    .items-table-container {
        margin-top: 10px;
        border-radius: var(--radius-lg);
    }

    .items-table th {
        padding: 8px 4px;
        font-size: 0.7rem;
    }

    .items-table td {
        padding: 4px;
    }

    .items-table input {
        padding: 4px 6px;
        font-size: 0.8rem;
    }

    .item-line-total {
        font-size: 0.8rem;
    }

    .remove-item {
        padding: 4px;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        min-width: auto;
    }

    .preview-sidebar {
        gap: 1.5rem;
    }

    .preview-card {
        border-radius: var(--radius-lg);
    }

    .preview-header {
        padding: 0.75rem 1rem;
    }

    .preview-header h3 {
        font-size: 0.9rem;
    }

    .live-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
    }

    .invoice-preview {
        padding: 8px;
        max-height: 500px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
    }

    /* Touch target sizes */
    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .remove-item,
    .file-input-btn,
    .color-option,
    .custom-color-input input[type="color"],
    .custom-color-input input[type="text"],
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
    }

    .remove-item {
        min-height: 36px;
        min-width: 36px;
    }

    .color-option {
        min-height: auto;
    }

    .color-circle {
        min-height: 28px;
        min-width: 28px;
    }
}

/* Mobile Large (up to 576px) */
@media (max-width: 576px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-badge {
        margin-bottom: 1rem;
    }

    .badge-pill {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    .form-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .ad-placeholder {
        padding: 1rem;
    }

    .ad-placeholder.vertical {
        min-height: 200px;
    }

    .color-option {
        min-width: 45px;
    }

    .color-circle {
        width: 26px;
        height: 26px;
    }

    .items-table {
        min-width: 800px;
    }

    .invoice-preview .details-box>div {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

/* Mobile Small (up to 480px) */
@media (max-width: 480px) {
    .tool-section {
        padding: 1.5rem 0;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-header p {
        font-size: 0.85rem;
    }

    .form-card {
        padding: 0.75rem;
    }

    .form-block {
        margin-bottom: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .block-header i {
        font-size: 0.9rem;
        padding: 0.3rem;
    }

    .block-header h3 {
        font-size: 0.9rem;
    }

    .field-group label {
        font-size: 0.7rem;
    }

    .field-group input,
    .field-group select,
    .field-group textarea {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }

    .color-options {
        gap: 0.25rem;
    }

    .color-option {
        min-width: 40px;
    }

    .color-circle {
        width: 24px;
        height: 24px;
    }

    .color-name {
        font-size: 0.55rem;
    }

    .items-table {
        min-width: 700px;
    }

    .items-table th {
        font-size: 0.65rem;
        padding: 6px 3px;
    }

    .items-table td {
        padding: 3px;
    }

    .items-table input {
        padding: 3px 4px;
        font-size: 0.75rem;
    }

    .item-line-total {
        font-size: 0.75rem;
    }

    .invoice-preview {
        padding: 6px;
        max-height: 400px;
    }

    .invoice-preview .company-name {
        font-size: 16px;
    }

    .invoice-preview .invoice-title {
        font-size: 20px;
    }

    .invoice-preview .section-heading {
        font-size: 11px;
    }

    .invoice-preview table {
        font-size: 9px;
    }

    .invoice-preview th {
        font-size: 9px;
        padding: 4px 2px;
    }

    .invoice-preview td {
        padding: 4px 2px;
    }

    .invoice-preview .totals {
        font-size: 10px;
        padding: 6px;
    }

    .invoice-preview .grand-total {
        font-size: 12px;
    }

    .invoice-preview .payment-info {
        font-size: 9px;
        padding: 6px;
    }

    .invoice-preview .notes-section {
        font-size: 9px;
    }
}

/* Mobile Extra Small (up to 360px) */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .form-card {
        padding: 0.5rem;
    }

    .block-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .block-header .btn-outline {
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .color-option {
        min-width: 36px;
    }

    .color-circle {
        width: 22px;
        height: 22px;
    }

    .color-name {
        font-size: 0.5rem;
    }

    .custom-color-input input[type="text"] {
        font-size: 0.8rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .btn-primary i,
    .btn-secondary i {
        font-size: 0.9rem;
    }

    .items-table {
        min-width: 650px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .preview-card {
        position: static;
    }

    .invoice-preview {
        max-height: 300px;
    }

    .form-card {
        max-height: 80vh;
        overflow-y: auto;
    }

    .site-header {
        position: relative;
    }
}

/* Fix for notch phones */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .container {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }
    }
}

/* High-resolution screens */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .btn-primary,
    .btn-secondary,
    .feature-card {
        border-width: 0.5px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* You can add dark mode styles here if needed */
}

/* ========================================= */
/* PRINT STYLES */
/* ========================================= */
@media print {

    .site-header,
    .hero-section,
    .ad-banner,
    .features-section,
    .site-footer,
    .form-wrapper,
    .preview-header,
    .form-actions,
    .color-theme-container,
    .btn-outline,
    .remove-item {
        display: none !important;
    }

    .tool-section {
        padding: 0;
    }

    .preview-card {
        box-shadow: none;
        border: none;
        position: static;
    }

    .invoice-preview {
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .invoice-preview .preview-invoice {
        font-size: 11pt;
    }

    .invoice-preview th {
        background: #4f46e5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .invoice-preview .grand-total {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ========================================= */
/* UTILITY CLASSES */
/* ========================================= */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.hide-on-mobile {
    display: block;
}

.show-on-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }

    .show-on-mobile {
        display: block;
    }
}

/* Hide old item styles */
.item-row,
.item-fields {
    display: none;
}


/* ========================================= */
/* HAMBURGER MENU STYLES */
/* ========================================= */

/* Hamburger Button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Hamburger Animation */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background: var(--primary-dark);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background: var(--primary-dark);
}

/* Navigation Menu Wrapper */
.nav-menu-wrapper {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    font-size: 1rem;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Desktop/Mobile visibility */
.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* ========================================= */
/* HAMBURGER MENU STYLES */
/* ========================================= */

/* Hamburger Button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Hamburger Animation */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background: var(--primary-dark);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background: var(--primary-dark);
}

/* Navigation Menu Wrapper */
.nav-menu-wrapper {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    font-size: 1rem;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Desktop/Mobile visibility */
.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* ========================================= */
/* RESPONSIVE HAMBURGER MENU */
/* ========================================= */

/* Tablet and Mobile */
@media (max-width: 992px) {
    .navbar {
        height: auto;
        padding: 1rem;
        position: relative;
    }

    /* Show hamburger on mobile */
    .hamburger {
        display: flex;
    }

    /* Hide desktop CTA on mobile */
    .desktop-only {
        display: none;
    }

    /* Show mobile CTA */
    .mobile-only {
        display: block;
    }

    /* Navigation Menu Wrapper - Hidden by default */
    .nav-menu-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: white;
        box-shadow: var(--shadow-xl);
        transition: right 0.3s ease;
        z-index: 1000;
        padding: 80px 2rem 2rem;
        overflow-y: auto;
    }

    /* Menu when active */
    .nav-menu-wrapper.active {
        right: 0;
        display: block;
    }

    /* Overlay when menu is open */
    .nav-menu-wrapper.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    /* Navigation Menu - Vertical layout */
    .nav-menu {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
    }

    .nav-menu li {
        width: 100%;
        text-align: left;
    }

    .nav-menu a {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-menu a::after {
        display: none;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        color: var(--primary);
        padding-left: 10px;
        border-bottom-color: var(--primary);
    }

    /* Mobile CTA button */
    .mobile-only .btn-sm {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
        padding: 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .nav-menu-wrapper {
        width: 90%;
        padding: 80px 1.5rem 1.5rem;
        display: none;
    }

    .nav-menu a {
        font-size: 1rem;
        padding: 0.6rem 0;
    }
}

/* Animation for menu items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-menu-wrapper.active .nav-menu li {
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(1) {
    animation-delay: 0.1s;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(2) {
    animation-delay: 0.2s;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(3) {
    animation-delay: 0.3s;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(4) {
    animation-delay: 0.4s;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(5) {
    animation-delay: 0.5s;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Remove old navbar styles */
@media (max-width: 992px) {
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        display: block;
    }

    .nav-brand {
        flex: 1;
    }
}