/**
 * AXIOM Wallet Generator - Light Theme
 * New Reality Design System
 */

/* ========================================
   DESIGN TOKENS
   ======================================== */

:root {
    /* New Reality Brand Colors */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #fb923c 100%);
    --gradient-accent: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    
    /* Base Colors */
    --purple-500: #6366f1;
    --purple-600: #4f46e5;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --magenta-500: #ec4899;
    --green-500: #10b981;
    --red-500: #ef4444;
    
    /* Background Colors - Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-hover: #f8fafc;
    
    /* Text Colors - Light Theme */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-on-gradient: #ffffff;
    
    /* Border & Shadow */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-colored: 0 10px 30px -5px rgba(99, 102, 241, 0.3);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LAYOUT
   ======================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: var(--spacing-xl);
}

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

.sidebar-logo svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: var(--spacing-xl);
    max-width: 1200px;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav-section {
    margin-bottom: var(--spacing-lg);
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-md);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--spacing-md);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: var(--text-on-gradient);
    box-shadow: var(--shadow-colored);
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Language Switcher */
.language-switcher {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.language-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-select:hover {
    border-color: var(--purple-500);
}

.language-select:focus {
    outline: none;
    border-color: var(--purple-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

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

/* ========================================
   CARDS
   ======================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: var(--spacing-lg);
}

/* Gradient Card */
.card-gradient {
    background: var(--gradient-primary);
    color: var(--text-on-gradient);
    border: none;
}

.card-gradient .card-title,
.card-gradient .text-muted {
    color: var(--text-on-gradient);
    opacity: 0.95;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-on-gradient);
    box-shadow: var(--shadow-colored);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(99, 102, 241, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--purple-500);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--text-on-gradient);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4);
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--purple-500);
}

.form-check span {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.input-text {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.2s ease;
}

.input-text:focus {
    outline: none;
    border-color: var(--purple-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ========================================
   WALLET-SPECIFIC COMPONENTS
   ======================================== */

.wallet-hero {
    text-align: center;
    padding: 60px var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
}

.wallet-hero-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-lg);
}

.wallet-hero-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wallet-hero-description {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.8;
}

/* Warning Box */
.warning-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.08) 100%);
    border: 2px solid var(--red-500);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.warning-box-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--red-500);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
}

.warning-box-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.warning-box strong {
    color: var(--red-500);
}

/* Success Box */
.success-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(52, 211, 153, 0.08) 100%);
    border: 2px solid var(--green-500);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

/* Seed Grid */
.seed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: var(--spacing-lg) 0;
}

.seed-word {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 14px;
    transition: all 0.2s ease;
}

.seed-word:hover {
    border-color: var(--purple-500);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.seed-word-number {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.seed-word-text {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

/* Address Display */
.address-display {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
    border: 2px solid var(--green-500);
    border-radius: var(--radius);
    margin: var(--spacing-lg) 0;
    font-family: var(--font-mono);
    color: var(--green-500);
    word-break: break-all;
}

/* QR Code */
.qr-wrapper {
    text-align: center;
    margin: var(--spacing-lg) 0;
}

.qr-container {
    display: inline-block;
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* Key Display */
.key-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    font-family: var(--font-mono);
    font-size: 13px;
    word-break: break-all;
    margin: var(--spacing-md) 0;
    position: relative;
    color: var(--text-primary);
}

.key-display.hidden-key {
    -webkit-text-security: disc;
    text-security: disc;
}

.key-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Checkbox Agreement */
.checkbox-agreement {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* Wallet Result Section */
.wallet-result-section {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

/* ========================================
   COLLAPSIBLE
   ======================================== */

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.collapsible-header:hover {
    color: var(--purple-500);
}

.collapsible-header svg {
    transition: transform 0.3s ease;
}

.collapsible-header.open svg {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.open {
    max-height: 1000px;
    padding: var(--spacing-md);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--green-500);
}

.toast.error {
    border-left: 4px solid var(--red-500);
}

.toast.info {
    border-left: 4px solid var(--blue-500);
}

.toast svg {
    flex-shrink: 0;
}

.toast.success svg {
    color: var(--green-500);
}

.toast.error svg {
    color: var(--red-500);
}

.toast.info svg {
    color: var(--blue-500);
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    font-size: 24px;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hidden {
    display: none !important;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.no-print {
    /* Hidden in print mode */
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--spacing-lg);
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .wallet-hero-title {
        font-size: 28px;
    }
    
    .seed-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    .toast {
        min-width: auto;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    body {
        background: white !important;
    }
    
    .sidebar,
    .btn,
    .warning-box,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .wallet-result-section {
        page-break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 20px;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-color);
}

[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: 260px;
}

@media (max-width: 768px) {
    [dir="rtl"] .main-content {
        margin-right: 0;
    }
}
