/**
 * VoiceSaaS Styles
 * Matching isbn.aiauthor.pub design (navy #1e3a5f, Inter font)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #1e3a5f;
    --primary-dark: #152a45;
    --primary-light: #2a4d7a;
    --secondary: #3b82f6;
    --accent: #f59e0b;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --bg-secondary: #f1f5f9;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

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

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-success:hover {
    background: #16a34a;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    display: flex;
    width: 100%;
}

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

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 4px;
}

.form-help {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Navigation */
.navbar {
    background: var(--primary);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.navbar-brand {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
}

.navbar-brand:hover {
    color: var(--white);
    text-decoration: none;
    opacity: 1;
}

.navbar-brand:focus {
    color: var(--white);
    text-decoration: none;
    outline: none;
}

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

.navbar-nav a {
    color: rgba(255,255,255,0.8);
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

/* Navbar toggle (3 dots - mobile) */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.navbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: all 0.3s;
}
.navbar-toggle:hover span {
    background: white;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 12px 24px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    font-size: 1rem;
}

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

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

.tab-content {
    display: none;
}

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

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

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.table tr:hover {
    background: var(--bg-secondary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background: rgba(30, 58, 95, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

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

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

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

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

/* File Upload */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(30, 58, 95, 0.05);
}

.upload-area-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--primary);
}

.upload-area-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-area-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Progress */
.progress {
    height: 8px;
    background: var(--border);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

/* Select */
.form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

/* Range Slider */
.form-range {
    width: 100%;
    height: 6px;
    border-radius: 9999px;
    appearance: none;
    background: var(--border);
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Spacing */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

/* Price display */
.price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.price-small {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Balance display */
.balance-display {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 700;
}

/* Status indicator */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-pending { background: var(--warning); }
.status-processing { background: var(--secondary); }
.status-completed { background: var(--success); }
.status-failed { background: var(--error); }

/* Footer */
.footer {
    background: var(--primary);
    color: var(--white);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
}

.footer-links a:hover {
    color: var(--white);
}

/* Advanced settings panel */
.advanced-toggle {
    cursor: pointer;
    user-select: none;
}

.advanced-panel {
    display: none;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-top: 16px;
}

.advanced-panel.open {
    display: block;
}

/* Range value display */
.range-value {
    font-weight: 600;
    color: var(--primary);
    min-width: 40px;
    display: inline-block;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.active {
    display: flex;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .navbar-nav {
        gap: 4px;
    }
    
    .navbar-nav a {
        padding: 6px 12px;
        font-size: 0.875rem;
    }
    
    .tabs {
        gap: 0;
    }
    
    .tab {
        padding: 10px 16px;
        font-size: 0.875rem;
    }
    
    .card {
        padding: 16px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* Auth pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

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

.auth-logo h1 {
    color: var(--primary);
    margin-bottom: 8px;
}

.auth-logo p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Hero section */
.hero {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 40px;
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 16px;
}

.hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 24px;
}

/* Pricing cards */
.pricing-card {
    text-align: center;
    padding: 32px;
}

.pricing-price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

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

.pricing-features {
    list-style: none;
    margin: 24px 0;
}

.pricing-features li {
    padding: 8px 0;
    color: var(--text-secondary);
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.feature-card {
    padding: 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(30, 58, 95, 0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 24px;
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* History item */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child {
    border-bottom: none;
}

.history-info h4 {
    margin-bottom: 4px;
}

.history-meta {
    display: flex;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   MOBILE NAVBAR (screens < 768px)
   ============================================ */
@media (max-width: 768px) {
    .navbar-container {
        flex-wrap: wrap;
        position: relative;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 4px;
        padding-top: 12px;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 12px;
    }
    
    .navbar-nav.show {
        display: flex;
    }
    
    .navbar-nav li {
        width: 100%;
    }
    
    .navbar-nav a {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
}
