
:root {
    /* Colors */
    --primary-gradient: linear-gradient(135deg, #ff416c, #ff4b2b);
    --secondary-gradient: linear-gradient(135deg, #ed213a, #93291e);
    --accent: #ff416c;
    --accent-dark: #d32f2f;
    
    /* Light Mode */
    --bg-color: #fffafa;
    --card-bg: #ffffff;
    --text-main: #2e1a1a;
    --text-muted: #5f4a4a;
    --border-color: #ede2e2;
    --input-bg: #ffffff;
    --nav-bg: rgba(255, 250, 250, 0.8);
    --footer-bg: #1f0a0a;
    --footer-text: #f2e0e0;
    
    /* Transitions */
    --transition: all 0.3s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(255, 65, 108, 0.1);
}

[data-theme="dark"] {
    --bg-color: #1a0f0f;
    --card-bg: #261616;
    --text-main: #f2e0e0;
    --text-muted: #b3a0a0;
    --border-color: #3a2525;
    --input-bg: #2e1c1c;
    --nav-bg: rgba(26, 15, 15, 0.8);
    --footer-bg: #0f0606;
    --footer-text: #d1c0c0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

button, .btn {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navbar Redesign: Floating Glass Island */
header {
    position: sticky;
    top: 15px;
    margin: 0 auto;
    width: calc(100% - 40px);
    max-width: 1300px;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    height: 80px;
    display: flex;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] header {
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

header.scrolled {
    height: 65px;
    top: 10px;
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] header.scrolled {
    background: rgba(15, 26, 20, 0.85);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 65, 108, 0.2));
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 65, 108, 0.03);
    padding: 8px 25px;
    border-radius: 100px;
    border: 1px solid rgba(255, 65, 108, 0.05);
    justify-self: center;
}

[data-theme="dark"] .nav-links {
    background: rgba(255, 255, 255, 0.03);
}

.nav-links a {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 100px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.nav-links a:hover {
    opacity: 1;
    background: rgba(255, 65, 108, 0.05);
}

.nav-links a.active {
    opacity: 1;
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.2);
}

.nav-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

/* Language Selector */
.lang-select-wrapper {
    position: relative;
}

.lang-select {
    appearance: none;
    background: var(--border-color);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 32px 8px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.lang-select:hover {
    border-color: var(--accent);
    background: var(--card-bg);
}

.lang-select-wrapper::after {
    content: '▾';
    font-size: 0.8rem;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
}

.theme-toggle:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Buttons */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    padding: 12px 28px;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 65, 108, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 10px 26px;
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
}

/* Hero Section */
.hero {
    padding: 100px 0;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(0, 176, 155, 0.05), transparent);
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
}

.hero-visual {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.floating-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: float 6s ease-in-out infinite;
    max-width: 350px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.floating-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: skewX(-25deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    100% { left: 200%; }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-logo {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 8px;
}

.card-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 1px;
}

.card-body {
    margin-bottom: 20px;
}

.card-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 2px solid var(--accent);
}

.card-footer span:first-child {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

.total-badge {
    background: var(--secondary-gradient);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(1deg); }
}

/* Sections Common */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    color: white;
}

/* Generator Tool Layout */
.tool-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 176, 155, 0.1);
}

/* Invoice Preview Styling */
.invoice-preview {
    background: white;
    color: #333;
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    min-height: 800px;
    position: sticky;
    top: 100px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    border-bottom: 4px solid var(--accent);
    padding-bottom: 20px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.preview-table th {
    background: #f8fcf9;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #eee;
}

.preview-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

/* FAQ Accordion */
.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--accent);
}

.faq-question {
    display: flex !important; /* Force override of global inline-flex */
    width: 100% !important;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: rgba(0, 0, 0, 0.02);
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: left;
    transition: var(--transition);
}

[data-theme="dark"] .faq-question {
    background: rgba(255, 255, 255, 0.03);
}

.faq-question:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent);
}

[data-theme="dark"] .faq-question:hover {
    background: rgba(255, 255, 255, 0.07);
}

.faq-question svg {
    flex-shrink: 0;
    margin-left: 20px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--accent);
    opacity: 0.8;
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
    opacity: 1;
}

.faq-answer {
    padding: 0 32px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.faq-item.active .faq-answer {
    padding: 0 32px 32px;
    max-height: 400px;
    opacity: 1;
}

.faq-answer p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1rem;
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}

/* Invoice Styles - 8 Distinct Layouts */

/* 1. Modern (Matches Image 1) */
.style-modern { font-family: 'Inter', sans-serif; }
.style-modern .preview-table th { background: var(--accent) !important; color: white !important; }
.style-modern .invoice-header { border-bottom: 2px solid var(--accent); padding-bottom: 20px; }

/* 2. Classic (Matches Image 3) */
.style-classic { font-family: 'Libre Baskerville', serif; }
.style-classic .invoice-header { border-bottom: 1px solid var(--accent); border-top: 1px solid var(--accent); padding: 20px 0; margin-bottom: 30px; }
.style-classic .preview-table th { background: transparent !important; border-bottom: 2px solid var(--accent); color: var(--accent) !important; font-style: italic; }

/* 3. Minimal - Zero borders, simple list */
.style-minimal { font-family: 'Inter', sans-serif; color: #444; }
.style-minimal .invoice-header { display: flex; flex-direction: column; align-items: center; text-align: center; }
.style-minimal .preview-table { border: none; }
.style-minimal .preview-table th { background: transparent !important; color: #999 !important; border-bottom: 1px solid #eee; }

/* 4. Creative (Matches Image 5) */
.style-creative { font-family: 'Outfit', sans-serif; }
.style-creative .invoice-header { 
    background: var(--accent); 
    color: white !important; 
    padding: 60px 40px; 
    margin: -40px -40px 40px; 
    border-radius: 0 0 50px 50px; 
    display: flex; 
    justify-content: space-between; 
}
.style-creative .invoice-header * { color: white !important; }
.style-creative .header-right h2 { font-size: 2.5rem; margin-top: 0; }

/* 5. Corporate (Matches Image 2) */
.style-corporate { font-family: 'Inter', sans-serif; position: relative; border-left: 20px solid var(--accent); padding-left: 30px !important; }
.style-corporate .preview-table th { background: var(--accent) !important; color: white !important; }

/* 6. Compact */
.style-compact { font-size: 13px; }
.style-compact .invoice-preview { padding: 20px !important; }
.style-compact .preview-table td { padding: 6px 10px; }

/* 7. Elegant */
.style-elegant { font-family: 'Libre Baskerville', serif; border: 4px double var(--accent); margin: 5px; padding: 30px !important; }
.style-elegant .invoice-header { text-align: center; border: none; }
.style-elegant .header-left, .style-elegant .header-right { width: 100%; text-align: center; }

/* 8. Bold - Dark footer and heavy weight */
.style-bold { font-family: 'Montserrat', sans-serif; text-transform: uppercase; border: 6px solid var(--accent); padding: 30px !important; }
.style-bold h1, .style-bold h2, .style-bold h3 { font-weight: 900; letter-spacing: -1px; }
.style-bold .preview-table th { background: var(--accent) !important; color: white !important; padding: 15px; }
.style-bold .total-row { 
    background: var(--accent); 
    color: white !important; 
    padding: 20px; 
    margin: 20px -30px -30px; 
}
.style-bold .total-row * { color: white !important; font-size: 1.4rem; }

/* End of Invoice Styles */

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    text-align: center;
    font-size: 0.9rem;
}

/* Mobile Nav */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: var(--text-main);
    border-radius: 3px;
    transition: var(--transition);
}

.item-row {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
    transition: var(--transition);
    display: grid;
    grid-template-columns: 2fr 0.6fr 1.1fr 1.1fr 1.1fr auto;
    gap: 12px;
}

.item-row:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.item-row input {
    padding: 10px 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text-main);
    width: 100%;
}

.item-row input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

/* Chrome, Safari, Edge, Opera */
.item-row input::-webkit-outer-spin-button,
.item-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.item-row input[type=number] {
  -moz-appearance: textfield;
}

.item-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 65, 108, 0.1);
    outline: none;
}

/* Media Queries */
@media (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 { font-size: 2.8rem; }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    header { 
        height: 70px; 
        top: 0;
        width: 100%;
        border-radius: 0;
        margin: 0;
        position: fixed;
    }
    
    .container {
        padding: 0 15px;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-color);
        flex-direction: column;
        justify-content: flex-start;
        padding: 40px 20px;
        border-radius: 0;
        border: none;
        border-top: 1px solid var(--border-color);
        transition: 0.3s ease-in-out;
        z-index: 999;
        overflow-y: auto;
        opacity: 1;
        display: flex;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        font-size: 1.1rem;
        padding: 15px;
    }

    .hamburger { display: flex; order: 3; }
    .logo { font-size: 1.1rem; order: 1; gap: 6px; }
    .nav-actions { order: 2; gap: 8px; flex: 1; justify-content: center; }
    
    .hero h1 { font-size: 2rem; }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .hero-btns {
        flex-direction: column;
    }
    
    .hero-btns .btn {
        width: 100%;
    }

    .nav-actions .btn-primary {
        display: none !important;
    }

    .item-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .item-row input[name="desc[]"] {
        grid-column: span 2;
    }

    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .row-total {
        grid-column: span 1;
        justify-content: flex-start;
    }

    .remove-item {
        grid-column: span 1;
        justify-self: end;
    }

    section {
        padding: 40px 0;
        scroll-margin-top: 80px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--nav-bg);
        backdrop-filter: blur(30px) saturate(200%);
        -webkit-backdrop-filter: blur(30px) saturate(200%);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 40px 20px;
        border-radius: 0;
        border: none;
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        display: flex;
        gap: 20px;
    }

    .nav-links.active {
        left: 0;
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        width: auto;
        text-align: center;
        font-size: 1.5rem;
        font-weight: 800;
        padding: 15px 30px;
        color: var(--text-main);
        background: transparent;
        border-radius: 20px;
    }

    .nav-links a.active {
        background: var(--primary-gradient);
        color: white;
    }

    .hamburger { 
        display: flex; 
        order: 3; 
        position: relative;
        z-index: 1001;
    }

    .hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(7px, 7px); }
    .hamburger.open span:nth-child(2) { opacity: 0; }
    .hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

    .logo { 
        font-size: 1.1rem; 
        order: 1; 
        gap: 6px; 
    }
    
    .nav-actions { 
        order: 2; 
        gap: 6px; 
        flex: 1; 
        justify-content: flex-end; 
        padding-right: 5px; 
    }

    .lang-select {
        padding: 6px 24px 6px 8px;
        font-size: 0.8rem;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    
    .hero { 
        padding: 60px 0 30px; 
        overflow: hidden; /* Prevent floating cards from causing scroll */
    }
    
    .hero h1 { 
        font-size: 1.8rem; 
        margin-bottom: 12px;
        line-height: 1.3;
    }
    
    .hero p { 
        font-size: 0.95rem; 
        margin-bottom: 25px; 
    }

    .hero-visual {
        display: none; /* Hide complex floating cards on mobile for performance and fit */
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-btns {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero-btns .btn {
        width: 100%;
        padding: 16px;
    }

    .nav-actions .start-now-btn {
        display: none !important;
    }

    .item-row {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 20px;
    }

    .item-row input[name="desc[]"] {
        grid-column: span 2;
    }

    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .row-total {
        grid-column: span 1;
        justify-content: flex-start;
        font-size: 1.1rem;
    }

    .remove-item {
        grid-column: span 1;
        justify-self: end;
        padding: 10px;
    }

    .tool-section {
        padding: 20px;
        border-radius: 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .invoice-preview {
        position: static;
        padding: 15px;
        min-height: auto;
        border-radius: 8px;
        margin-top: 20px;
    }
    
    .preview-table th, .preview-table td {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Touch Optimizations */
@media (max-width: 1024px) {
    button, a, input, select, textarea {
        touch-action: manipulation;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }
    
    header, footer, .hero, .section-header, .invoice-form-fields, .hero-visual, .nav-actions, .nav-links, .hamburger, .hero-btns, section:not(#generator), #back-to-top {
        display: none !important;
    }

    html, body {
        height: auto !important;
        overflow: visible !important;
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #generator {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    .tool-section, .tool-grid {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .invoice-preview-container {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .invoice-preview {
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        height: auto !important;
        padding: 10mm !important;
        margin: 0 !important;
        background: white !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
