/**
 * BOLT RECEIPT API - Main Stylesheet
 * White theme with professional B2B SaaS design
 */

:root {
    --primary: #000000;
    --primary-light: #333333;
    --secondary: #666666;
    --accent: #0066FF;
    --accent-light: #3385FF;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --background: #FFFFFF;
    --surface: #FAFAFA;
    --surface-elevated: #FFFFFF;
    --border: #E5E5E5;
    --border-light: #F0F0F0;
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-muted: #999999;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==================== LAYOUT ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== NAVIGATION ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    height: 72px;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 20px;
}

.navbar-logo svg {
    width: 36px;
    height: 36px;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--text-primary);
    background: var(--surface);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--secondary);
}

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

.btn-accent:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

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

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== HERO ==================== */
.hero {
    padding: 160px 0 100px;
    text-align: center;
    background: linear-gradient(180deg, var(--surface) 0%, var(--background) 100%);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero h1 {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.hero h1 span {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
}

.hero-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== SECTIONS ==================== */
.section {
    padding: 100px 0;
}

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

.section-label {
    display: inline-block;
    padding: 6px 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.section h2 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.section p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ==================== FEATURES GRID ==================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
}

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

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

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

/* ==================== PRICING ==================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.pricing-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    transition: var(--transition);
}

.pricing-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 4px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
}

.pricing-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pricing-price {
    margin-bottom: 24px;
}

.pricing-amount {
    font-size: 42px;
    font-weight: 800;
}

.pricing-period {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
}

.pricing-features li svg {
    width: 18px;
    height: 18px;
    color: var(--success);
    flex-shrink: 0;
}

/* ==================== CODE BLOCK ==================== */
.code-block {
    background: #0D1117;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 24px 0;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #161B22;
    border-bottom: 1px solid #30363D;
}

.code-lang {
    font-size: 12px;
    color: #8B949E;
    text-transform: uppercase;
}

.code-copy {
    background: transparent;
    border: none;
    color: #8B949E;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.code-copy:hover {
    color: white;
}

.code-block pre {
    padding: 20px;
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #E6EDF3;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-label span {
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

.form-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.form-error {
    font-size: 13px;
    color: var(--danger);
    margin-top: 6px;
}

/* ==================== AUTH PAGES ==================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--surface);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.auth-logo p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ==================== DASHBOARD ==================== */
.dashboard {
    padding-top: 72px;
    min-height: 100vh;
    background: var(--surface);
}

.dashboard-sidebar {
    position: fixed;
    top: 72px;
    left: 0;
    width: 260px;
    height: calc(100vh - 72px);
    background: white;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0 12px;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-nav a svg {
    width: 20px;
    height: 20px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--surface);
    color: var(--text-primary);
}

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

.sidebar-section {
    padding: 16px 24px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.dashboard-main {
    margin-left: 260px;
    padding: 32px;
}

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

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 700;
}

/* ==================== STATS CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

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

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

/* ==================== CARDS ==================== */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 20px;
    text-align: left;
    font-size: 14px;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.table td {
    border-bottom: 1px solid var(--border-light);
}

.table tr:hover td {
    background: var(--surface);
}

.table .badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(16,185,129,0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

.badge-secondary {
    background: var(--surface);
    color: var(--text-secondary);
}

/* ==================== API KEY DISPLAY ==================== */
.api-key-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 13px;
}

.api-key-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.api-key-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.api-key-copy:hover {
    color: var(--text-primary);
}

/* ==================== UPLOAD AREA ==================== */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(0,102,255,0.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--surface);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.upload-area h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-area p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ==================== ALERTS ==================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-success {
    background: rgba(16,185,129,0.1);
    color: var(--success);
}

.alert-warning {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
}

.alert-danger {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

.alert-info {
    background: rgba(0,102,255,0.1);
    color: var(--accent);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--primary);
    color: white;
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand svg {
    width: 40px;
    height: 40px;
    margin-bottom: 20px;
}

.footer-brand p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
}

.footer-column h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-column ul {
    list-style: none;
}

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

.footer-column a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom p {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .navbar-nav {
        display: none;
    }
    
    .hero h1 {
        font-size: 40px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 24px;
    }
    
    .section h2 {
        font-size: 32px;
    }
    
    .features-grid,
    .pricing-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ==================== LOADING ==================== */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== TOGGLE ==================== */
.toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-input:checked + .toggle-slider::after {
    left: 22px;
}

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}
