/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
}

:root {
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --secondary-color: #64748b;
    --accent-color: #f8fafc;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

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

.nav-brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5b21b6 0%, #6b21a8 100%);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 20px 50px;
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero-content {
    flex: 1;
    padding-right: 40px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    color: white;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Terminal Demo */
.terminal-demo {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
}

.terminal-header {
    background: var(--primary-hover);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-close { background: #ff5f57; }
.btn-minimize { background: #ffbd2e; }
.btn-maximize { background: #28ca42; }

.terminal-title {
    color: #8b949e;
    font-size: 12px;
    font-weight: 500;
}

.terminal-body {
    padding: 20px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.terminal-line {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt {
    color: #7c3aed;
    font-weight: 600;
}

.command {
    color: #ffffff;
}

.output {
    color: var(--success-color);
}

.cursor {
    background: #ffffff;
    width: 8px;
    height: 16px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

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

/* Features Section */
.features {
    padding: 100px 0;
    background: #f8fafc;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Pricing Section */
.pricing {
    padding: 100px 0;
    background: white;
}

.pricing h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    color: var(--text-primary);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    border-width: 2px;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: white;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.pricing-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}

.price span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pricing-features {
    list-style: none;
    margin-bottom: 32px;
}

.pricing-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid #f3f4f6;
}

.pricing-features li:last-child {
    border-bottom: none;
}

/* Dashboard Styles */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

.dashboard-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
    gap: 12px;
}

.nav-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

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

.nav-icon {
    font-size: 1.2rem;
}

.dashboard-main {
    flex: 1;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ... existing invoice styles ... */

.invoice-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.form-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.items-section {
    margin-bottom: 30px;
}

.items-section h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.items-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 40px;
    gap: 10px;
    padding: 10px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 4px;
    margin-bottom: 10px;
}

.item-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 40px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.item-row input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.item-row .amount {
    padding: 8px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    text-align: right;
    font-weight: 500;
}

.remove-item {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.remove-item:hover {
    background: #dc2626;
}

#add-item {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

#add-item:hover {
    background: linear-gradient(135deg, #5b21b6 0%, #6b21a8 100%);
}

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

.actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

#preview-btn {
    background: var(--gradient-primary);
    color: white;
}

#preview-btn:hover {
    background: linear-gradient(135deg, #5b21b6 0%, #6b21a8 100%);
}

#download-btn {
    background: var(--secondary-color);
    color: white;
}

#download-btn:hover {
    background: #4b5563;
}

.preview-section {
    position: sticky;
    top: 20px;
}

.invoice-preview {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-height: 600px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.invoice-title {
    font-size: 2rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.invoice-details {
    text-align: right;
}

.invoice-details div {
    margin-bottom: 5px;
}

.invoice-parties {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.party {
    flex: 1;
}

.party h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.party-info {
    white-space: normal;
    color: var(--text-secondary);
    line-height: 1.4;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.invoice-table th,
.invoice-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.invoice-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-secondary);
}

.invoice-table .text-right {
    text-align: right;
}

.invoice-table .text-center {
    text-align: center;
}

.invoice-totals {
    max-width: 300px;
    margin-left: auto;
    margin-bottom: 30px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.total-row.final {
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-color);
    border-top: 2px solid var(--primary-color);
    color: var(--text-primary);
}

.invoice-notes {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 20px;
}

/* History Tab */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.history-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.invoice-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.invoice-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.invoice-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.invoice-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.invoice-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.paid {
    background: #dcfce7;
    color: #166534;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.invoice-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Analytics Tab */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.analytics-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.analytics-card h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.metric {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.metric-change {
    font-size: 0.9rem;
    font-weight: 500;
}

.metric-change.positive {
    color: var(--success-color);
}

.metric-change.negative {
    color: var(--danger-color);
}

/* Settings Tab */
.settings-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

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

.settings-section .form-group:last-of-type {
    margin-bottom: 30px;
}

.subscription-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.subscription-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscription-badge.free {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.subscription-badge.pro {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.pro-banner {
    background: var(--gradient-primary);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.pro-banner-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.pro-banner-content p {
    margin-bottom: 16px;
    opacity: 0.9;
}

.pro-banner-content .btn-primary {
    background: white;
    color: var(--primary-color);
    border: none;
}

.pro-banner-content .btn-primary:hover {
    background: #f8fafc;
}

.pro-feature {
    background: var(--gradient-primary);
    color: white;
    position: relative;
}

.pro-feature.disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.pro-feature.disabled:hover {
    background: #9ca3af;
}

#template-select option:disabled {
    color: #9ca3af;
}

#template-select option:disabled::after {
    content: " (Pro Only)";
}

.pro-support {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.pro-support:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Template Styles */
.invoice-preview.template-classic {
    /* Default classic styling - already defined */
}

.invoice-preview.template-modern {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.invoice-preview.template-modern .invoice-header {
    background: var(--gradient-primary);
    color: white;
    padding: 30px;
    margin: -40px -40px 40px -40px;
    border-radius: 8px 8px 0 0;
}

.invoice-preview.template-modern .invoice-title {
    color: white;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.invoice-preview.template-modern .invoice-details {
    color: rgba(255, 255, 255, 0.9);
}

.invoice-preview.template-modern .invoice-table th {
    background: var(--gradient-primary);
    color: white;
}

.invoice-preview.template-minimal {
    border: none;
    box-shadow: none;
    background: white;
}

.invoice-preview.template-minimal .invoice-header {
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 20px;
}

.invoice-preview.template-minimal .invoice-title {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.invoice-preview.template-minimal .invoice-table {
    border: none;
}

.invoice-preview.template-minimal .invoice-table th {
    background: none;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.invoice-preview.template-minimal .invoice-table td {
    border-bottom: 1px solid #f1f5f9;
}

.invoice-preview.template-minimal .total-row.final {
    background: #f8fafc;
    padding: 12px;
    border-radius: 4px;
    margin: 8px 0;
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 120px 20px 50px;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 40px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-links {
        gap: 16px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard {
        flex-direction: column;
    }
    
    .dashboard-sidebar {
        width: 100%;
        order: 2;
    }
    
    .dashboard-main {
        order: 1;
    }
    
    .invoice-editor {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-grid,
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .items-header,
    .item-row {
        grid-template-columns: 2fr 1fr 1fr 1fr 40px;
        font-size: 12px;
    }
    
    .invoice-preview {
        padding: 20px;
    }
    
    .invoice-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .invoice-parties {
        flex-direction: column;
        gap: 20px;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}