/* ==================== CSS Variables & Themes ==================== */

:root, [data-theme="dark"] {
    --bg-primary: #0a0e27;
    --bg-secondary: #141935;
    --bg-card: #1a1f3a;
    --bg-hover: #252b4a;

    --text-primary: #ffffff;
    --text-secondary: #a0a8c1;
    --text-muted: #6b7280;

    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.3);

    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);

    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);

    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.2);

    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.1);
    --warning: #d97706;
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.1);

    --border: rgba(0, 0, 0, 0.1);
    --shadow: rgba(0, 0, 0, 0.1);

    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

[data-theme="tos"] {
    --bg-primary: #0d1f1a;
    --bg-secondary: #152e27;
    --bg-card: #1a3d34;
    --bg-hover: #244d42;

    --text-primary: #ffffff;
    --text-secondary: #a8d5c5;
    --text-muted: #6b8f7f;

    --accent-primary: #10b981;
    --accent-hover: #059669;
    --accent-glow: rgba(16, 185, 129, 0.3);

    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.2);
    --warning: #facc15;
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);

    --border: rgba(16, 185, 129, 0.2);
    --shadow: rgba(0, 0, 0, 0.4);

    --gradient-1: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-2: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
}

[data-theme="purple"] {
    --bg-primary: #1a0f2e;
    --bg-secondary: #2a1b3d;
    --bg-card: #3d2667;
    --bg-hover: #4d3380;

    --text-primary: #ffffff;
    --text-secondary: #d8b4fe;
    --text-muted: #a78bca;

    --accent-primary: #a855f7;
    --accent-hover: #9333ea;
    --accent-glow: rgba(168, 85, 247, 0.3);

    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.2);
    --warning: #fbbf24;
    --danger: #f472b6;
    --danger-glow: rgba(244, 114, 182, 0.2);

    --border: rgba(168, 85, 247, 0.2);
    --shadow: rgba(0, 0, 0, 0.4);

    --gradient-1: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --gradient-2: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
}

[data-theme="ocean"] {
    --bg-primary: #0c1e2e;
    --bg-secondary: #143247;
    --bg-card: #1a4660;
    --bg-hover: #225a7a;

    --text-primary: #ffffff;
    --text-secondary: #a5d8ff;
    --text-muted: #74c0fc;

    --accent-primary: #3b9eff;
    --accent-hover: #228be6;
    --accent-glow: rgba(59, 158, 255, 0.3);

    --success: #20c997;
    --success-glow: rgba(32, 201, 151, 0.2);
    --warning: #ffd43b;
    --danger: #ff6b9d;
    --danger-glow: rgba(255, 107, 157, 0.2);

    --border: rgba(59, 158, 255, 0.2);
    --shadow: rgba(0, 0, 0, 0.4);

    --gradient-1: linear-gradient(135deg, #3b9eff 0%, #20c997 100%);
    --gradient-2: linear-gradient(135deg, #228be6 0%, #15aabf 100%);
}

/* ==================== Base Styles ==================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

code, .wallet-address, .wallet-private-key {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', 'Consolas', monospace;
}

/* ==================== Theme Switcher ==================== */

/* Settings Menu (Hamburger) */
.settings-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.hamburger-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
    backdrop-filter: blur(10px);
}

.hamburger-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
    transform: scale(1.05);
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
}

.menu-content {
    position: absolute;
    top: 60px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.menu-content.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
    transform: scale(1.1);
}

.theme-btn.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

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

/* Language Selector */
.language-selector {
    position: relative;
    margin-left: 10px;
}

.lang-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
    transform: scale(1.1);
}

.lang-btn svg {
    width: 20px;
    height: 20px;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.lang-dropdown::-webkit-scrollbar {
    width: 6px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 10px;
    font-size: 0.9rem;
}

.language-option:hover {
    background: var(--bg-hover);
}

.language-option.active {
    background: var(--bg-secondary);
}

.language-option span:first-child {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.lang-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-icon svg {
    width: 16px;
    height: 16px;
}

/* ==================== Container ==================== */

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

/* ==================== Header ==================== */

.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.6s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 40px var(--accent-glow);
    animation: pulse 3s ease-in-out infinite;
}

.logo-icon svg {
    width: 50px;
    height: 50px;
}

.logo-icon .tos-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ==================== Cards ==================== */

.warning-card,
.controls-card,
.wallet-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
}

.warning-card:hover,
.controls-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow);
}

/* ==================== Warning Card ==================== */

.warning-card {
    display: flex;
    gap: 10px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-left: 4px solid var(--warning);
    padding: 12px 20px !important;
    margin-bottom: 20px !important;
}

.warning-icon {
    width: 32px;
    height: 32px;
    background: var(--warning);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.warning-icon svg {
    width: 18px;
    height: 18px;
}

.warning-content h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--warning);
    margin-top: 0;
}

.warning-content ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.warning-content li {
    padding: 2px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.3;
    font-size: 0.85rem;
}

.warning-content li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--warning);
    font-weight: bold;
    font-size: 0.85rem;
}

/* ==================== Controls Card ==================== */

.network-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-label:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    transform: scale(1.02);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.radio-label input[type="radio"]:checked ~ .radio-text strong {
    color: var(--accent-primary);
}

.radio-custom {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-text strong {
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.radio-text small {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== Buttons ==================== */

.btn-generate {
    width: 100%;
    padding: 20px;
    background: var(--gradient-2);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* ==================== Wallet Card ==================== */

.wallet-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    animation: fadeInUp 0.6s ease;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.wallet-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

.network-badge {
    padding: 8px 20px;
    background: var(--accent-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* ==================== Wallet Sections ==================== */

.wallet-section {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.wallet-section:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px var(--accent-glow);
}

.address-section {
    border-left: 4px solid var(--success);
}

.private-section {
    border-left: 4px solid var(--danger);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.section-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.section-icon.green {
    background: var(--success);
    box-shadow: 0 0 20px var(--success-glow);
}

.section-icon.red {
    background: var(--danger);
    box-shadow: 0 0 20px var(--danger-glow);
}

.section-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.section-icon svg {
    width: 28px;
    height: 28px;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}

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

/* ==================== Wallet Content ==================== */

.wallet-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 30px;
    align-items: center;
}

@media (max-width: 768px) {
    .wallet-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.qr-container {
    background: white;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
}

.qr-container canvas {
    display: block;
    width: 200px;
    height: 200px;
}

.key-display {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    word-break: break-all;
}

.key-display code {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--accent-primary);
}

.btn-copy {
    background: var(--accent-primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.btn-copy svg {
    width: 20px;
    height: 20px;
}

/* ==================== Wallet Actions ==================== */

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

@media (max-width: 768px) {
    .wallet-actions {
        flex-direction: column;
    }
}

.btn-action {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-action svg {
    width: 22px;
    height: 22px;
}

.btn-print {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* ==================== Footer ==================== */

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.secure-badge {
    height: 80px;
    width: auto;
    flex-shrink: 0;
}

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

.footer p {
    margin: 8px 0;
}

.footer-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

/* ==================== Loading Overlay ==================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==================== Toast ==================== */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
    min-width: 200px;
}

.toast.hidden {
    display: none;
}

/* ==================== Animations ==================== */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease;
}

/* ==================== Utility Classes ==================== */

.hidden {
    display: none !important;
}

/* ==================== Print Styles ==================== */

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 10px;
        margin: 0;
        padding: 0;
    }

    * {
        box-sizing: border-box;
    }

    .container {
        max-width: 100%;
        padding: 5px 10px;
    }

    .header {
        margin-bottom: 5px;
        text-align: center;
    }

    .logo-container {
        gap: 5px;
        flex-direction: row;
        align-items: center;
    }

    .logo-icon {
        width: 30px;
        height: 30px;
    }

    .logo-icon .tos-logo {
        width: 28px;
        height: 28px;
    }

    .logo-text h1 {
        font-size: 1.2rem;
        margin: 0;
        line-height: 1.2;
    }

    .subtitle {
        font-size: 0.65rem;
        margin: 0;
        line-height: 1.2;
    }

    .wallet-card {
        background: white;
        box-shadow: none;
        border: 2px solid #000;
        page-break-inside: avoid;
        padding: 8px;
        margin-bottom: 0;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .wallet-header {
        margin-bottom: 5px;
    }

    .wallet-header h2 {
        font-size: 1rem;
        margin: 0;
        line-height: 1.2;
    }

    .network-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .wallet-section {
        background: #f5f5f5;
        border: 1px solid #000;
        page-break-inside: avoid;
        padding: 6px;
        margin-bottom: 5px;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .section-header {
        margin-bottom: 5px;
        gap: 6px;
    }

    .section-icon {
        width: 24px;
        height: 24px;
    }

    .section-icon svg {
        width: 14px;
        height: 14px;
    }

    .section-header h3 {
        font-size: 0.85rem;
        margin: 0;
        line-height: 1.2;
    }

    .section-desc {
        font-size: 0.6rem;
        margin: 0;
        line-height: 1.2;
    }

    .wallet-content {
        grid-template-columns: auto 1fr;
        gap: 8px;
        align-items: center;
    }

    .qr-container {
        background: white;
        border: 1px solid #000;
        padding: 3px;
    }

    .qr-container > div,
    .qr-container canvas,
    .qr-container img {
        width: 80px !important;
        height: 80px !important;
        display: block;
    }

    .key-display {
        background: white;
        border: 1px solid #000;
        padding: 5px 8px;
        font-size: 0.6rem;
    }

    .key-display code {
        color: #000;
        font-size: 0.6rem;
        line-height: 1.3;
        word-break: break-all;
    }

    /* Seed Phrase - single column layout */
    .seed-section .wallet-content {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .seed-section .key-display {
        display: none !important;
    }

    .seed-words-container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .seed-words {
        background: white;
        border: 1px solid #000;
        page-break-inside: avoid;
        padding: 4px;
        gap: 3px;
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
        box-sizing: border-box;
    }

    .seed-word {
        background: white;
        border: 1px solid #333;
        padding: 2px 4px;
        gap: 3px;
        min-width: 0;
        overflow: visible;
        box-sizing: border-box;
    }

    .seed-word-number {
        background: #333 !important;
        color: white !important;
        width: 16px;
        height: 16px;
        font-size: 0.55rem;
        line-height: 1;
        flex-shrink: 0;
    }

    .seed-word-text {
        color: #000;
        font-size: 0.65rem;
        line-height: 1.2;
        overflow: visible;
        word-break: normal;
        white-space: normal;
        min-width: 0;
    }

    @page {
        margin: 0.8cm 1cm;
        size: A4 portrait;
    }

    /* Force single page and optimize layout */
    html, body {
        height: auto;
        overflow: visible;
    }

    .wallet-section:last-child {
        margin-bottom: 0;
    }

    /* Adjust elements to save space */
    .section-header div > * {
        margin: 0 !important;
    }
}

/* ==================== Responsive Design ==================== */

@media (max-width: 768px) {
    .logo-text h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    /* Hamburger menu on mobile */
    .settings-menu {
        top: 10px;
        right: 10px;
    }

    .hamburger-btn {
        width: 44px;
        height: 44px;
    }

    .menu-content {
        top: 54px;
    }

    .theme-btn {
        width: 36px;
        height: 36px;
    }

    /* Language dropdown positioning for mobile */
    .lang-dropdown {
        right: 0;
        left: auto;
        max-height: 300px;
        overflow-y: auto;
    }

    /* Footer responsive layout on mobile */
    .footer {
        flex-direction: column;
        gap: 16px;
        padding: 30px 20px;
    }

    .secure-badge {
        height: 60px;
    }

    .wallet-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .qr-container canvas {
        width: 150px;
        height: 150px;
    }

    /* Make seed words responsive - auto-fit columns based on available space */
    .seed-words {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
        padding: 15px;
    }

    .seed-word {
        padding: 6px 10px;
        gap: 6px;
    }

    .seed-word-number {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .seed-word-text {
        font-size: 0.85rem;
    }

    /* Make copy button fit within container */
    .seed-section .btn-copy {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
        max-width: 100%;
    }

    .seed-section .key-display {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    /* Make seed words 2 columns on very small screens */
    .seed-words {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 6px;
        padding: 10px;
    }

    .seed-word {
        padding: 5px 8px;
        gap: 5px;
    }

    .seed-word-number {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }

    .seed-word-text {
        font-size: 0.8rem;
    }

    /* Smaller menu on very small screens */
    .hamburger-btn {
        width: 40px;
        height: 40px;
    }

    .menu-content {
        top: 50px;
    }

    .theme-btn {
        width: 32px;
        height: 32px;
    }

    /* Smaller secure badge on very small screens */
    .secure-badge {
        height: 50px;
    }

    .theme-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ==================== Seed Phrase Styles ==================== */

.seed-section {
    border-left: 4px solid #f59e0b;
}

.seed-section .wallet-content {
    grid-template-columns: 1fr;
    gap: 20px;
}

.seed-words-container {
    width: 100%;
}

.seed-section .key-display {
    justify-content: center;
    padding: 15px;
}

.seed-section .btn-copy {
    width: auto;
    max-width: 100%;
    height: auto;
    padding: 12px 24px;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.seed-words {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.seed-word {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', 'Courier New', 'Consolas', monospace;
    transition: all 0.2s ease;
}

.seed-word:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.seed-word-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--gradient-1);
    color: white;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.seed-word-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
