/* Vault Created Page - Aligned with Create Vault Design System */

:root {
    /* Matching create-vault.css color system */
    --bg-page: #000000;
    --bg-container: #0B0E14;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border-color: #1e293b;
    --gold-primary: #bb9954;
    --gold-dim: rgba(187, 153, 84, 0.4);
    --gold-glow: rgba(187, 153, 84, 0.15);
    --bg-card: #0f1115;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --detail-bg: #11151d;
}

[data-theme="light"] {
    --bg-page: #f5f5f5;
    --bg-container: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --gold-primary: #947225;
    --gold-dim: rgba(148, 114, 37, 0.3);
    --gold-glow: rgba(148, 114, 37, 0.1);
    --bg-card: #f8fafc;
    --border-subtle: rgba(0, 0, 0, 0.1);
    --detail-bg: #f9fafb;
}

body.vault-created-page {
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

.confirmation-container {
    max-width: 900px;
    width: 95%;
    margin: 6rem auto 4rem;
    background: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Glow Effect (matching create-vault.css) */
.confirmation-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(600px circle at 50% 0%,
            rgba(187, 153, 84, 0.1),
            transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.confirmation-container:hover::before {
    opacity: 1;
}

/* Ensure content is above glow */
.confirmation-container>* {
    position: relative;
    z-index: 1;
}

/* --- Status Header --- */
.status-banner {
    text-align: center;
    margin-bottom: 3rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #FFC107;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.status-dot {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.status-text h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .status-text h3 {
    background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* --- Grid Layout --- */
.content-grid-row {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
    align-items: start;
}

/* --- Vault ID Section --- */
.vault-id-section {
    background: var(--detail-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vault-id-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    opacity: 0.5;
}

.section-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold-primary);
    margin-bottom: 1rem;
}

.id-display-box {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(187, 153, 84, 0.3);
    word-break: break-all;
}

[data-theme="light"] .id-display-box {
    color: var(--text-primary);
    text-shadow: none;
}

.action-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-action:hover {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
    color: #000;
    box-shadow: 0 4px 15px var(--gold-glow);
    transform: translateY(-2px);
}

[data-theme="light"] .btn-action {
    background: #fff;
    color: var(--text-primary);
}

[data-theme="light"] .btn-action:hover {
    background: var(--gold-primary);
    color: #fff;
}

/* --- Keys Section --- */
.keys-section {
    display: flex;
    flex-direction: column;
}

.keys-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.keys-title {
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.critical-tag {
    font-size: 0.75rem;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    margin-left: 0;
    margin-top: 0.5rem;
    letter-spacing: 0.5px;
    display: inline-block;
}

.btn-download-all {
    background: #fff;
    color: #000;
    border: none;
    padding: 0.65rem 1.1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-download-all:hover {
    background: var(--gold-primary);
    box-shadow: 0 0 15px var(--gold-glow);
}

.keys-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.key-item {
    background: var(--detail-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    transition: all 0.3s ease;
}

.key-item:hover {
    border-color: var(--gold-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transform: translateX(4px);
}

[data-theme="light"] .key-item {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .key-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.key-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1;
    height: 100%;
}

.key-number-badge {
    color: var(--text-secondary);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    opacity: 0.7;
    font-weight: 500;
}

.key-display {
    display: none;
    /* Hidden for compact layout */
}

.key-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold-primary);
    transform: scale(1.1);
    opacity: 1;
}

[data-theme="light"] .btn-icon {
    color: #64748B;
}

[data-theme="light"] .btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--gold-primary);
}

/* --- Backup Disclosure --- */
.backup-disclosure {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.backup-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: inline-block;
}

.backup-link:hover {
    color: var(--gold-primary);
}

.not-recommended {
    color: #ef4444;
    font-style: italic;
    font-size: 0.85rem;
}

/* Backup status animation */
.backup-status {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.status-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(187, 153, 84, 0.2);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.status-text {
    color: var(--gold-primary);
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.status-text.ready {
    color: #4ade80;
    font-size: 1rem;
    font-weight: 600;
}

.backup-status.ready .status-spinner {
    display: none;
}

.backup-status .btn-download-all {
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    animation: slideUp 0.4s ease forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-theme="light"] .status-spinner {
    border-color: rgba(187, 153, 84, 0.3);
    border-top-color: var(--gold-primary);
}

[data-theme="light"] .status-text {
    color: #947225;
}

[data-theme="light"] .status-text.ready {
    color: #16a34a;
}

/* --- Footer Details --- */
.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    border-top: 2px solid var(--border-subtle);
    padding-top: 3rem;
    margin-top: 3rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
    min-width: 0;
    overflow: hidden;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-subtle);
}

[data-theme="light"] .detail-item {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .detail-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.detail-value {
    font-family: 'Space Mono', monospace;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.detail-value.pending {
    color: #FFC107;
}

.tx-link {
    color: var(--gold-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
    max-width: 100%;
    overflow: hidden;
}

.tx-link:hover {
    opacity: 0.8;
}

.tx-hash {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Key View Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: var(--bg-container);
    border: 1px solid var(--gold-primary);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(187, 153, 84, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    color: var(--gold-primary);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.btn-close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

#modalKeyContent {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    resize: none;
    outline: none;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 300px;
}

[data-theme="light"] #modalKeyContent {
    background: #F1F5F9;
    color: #334155;
    border-color: #CBD5E1;
}

#modalKeyContent::-webkit-scrollbar {
    width: 8px;
}

#modalKeyContent::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

[data-theme="light"] #modalKeyContent::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

.modal-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Warning Modal */
.warning-modal {
    border-color: #ef4444;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.2);
}

.text-danger {
    color: #ef4444 !important;
}

.warning-checklist {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.warning-checklist li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #cbd5e1;
}

.warning-checklist li::before {
    content: '⚠️';
    position: absolute;
    left: 0;
    top: 0.5rem;
    font-size: 0.8rem;
}

[data-theme="light"] .warning-checklist li {
    color: #64748b;
}

.btn-danger {
    background: #ef4444;
    border: none;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: #94a3b8;
}

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

/* --- Header Controls --- */
.vault-header-controls {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    gap: 1rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-close-page:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

/* Responsive */
@media (max-width: 900px) {
    .content-grid-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .vault-id-section {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .confirmation-container {
        padding: 1.5rem;
        margin-top: 4rem;
    }

    .status-text h3 {
        font-size: 1.75rem;
    }

    .id-display-box {
        font-size: 1.1rem;
    }

    .key-item {
        padding: 0.8rem 1rem;
    }

    .key-display {
        font-size: 0.9rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .vault-header-controls {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 600px) {
    .details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }

    .content-grid-row {
        margin-bottom: 2rem;
    }
}