/**
 * PQC Identity - Centralized Global Design System & Styles
 */

/* Modular Subsystem Styles (Must be at top per CSS specification) */
@import url('./modules/components.css');
@import url('./modules/dashboard.css');
@import url('./modules/edit_app.css');
@import url('./modules/admin.css');
@import url('./modules/auth.css');
@import url('./modules/account.css');
@import url('./modules/merchant.css');

/* 1. Base Typography & Body Defaults */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #0b1120;
    color: #f8fafc;
    overflow-x: hidden;
}

/* 2. Smooth Scroll & Lenis Recommended CSS */
html.lenis, html.lenis body {
    height: auto;
}
.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}
.lenis.lenis-stopped {
    overflow: hidden;
}
.lenis.lenis-smooth iframe {
    pointer-events: none;
}

/* 3. Global & Custom Scrollbar */
::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover,
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 4. Glassmorphism Design Tokens */
.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.glass-hover:hover {
    background: rgba(255, 255, 255, 0.06);
}
.preview-glass {
    background: rgba(11, 17, 32, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.card { 
    background: rgba(255, 255, 255, 0.02); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08); 
    border-radius: 16px; 
    padding: 20px; 
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background 0.3s ease;
}
.card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 9px 14px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.input:focus {
    border-color: #2dd4bf;
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 0 2px rgba(45,212,191,0.2), inset 0 2px 4px rgba(0,0,0,0.2);
}
.input:disabled { opacity: 0.5; cursor: not-allowed; }
.label { display: block; font-size: 12px; font-weight: 500; color: #94a3b8; margin-bottom: 6px; }
.text-gradient { background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 16px; font-size: 13px; font-weight: 500; border-radius: 8px; transition: all 0.2s ease; cursor: pointer; white-space: nowrap; border: 1px solid transparent; line-height: 1.4; }
.btn-primary { background: linear-gradient(135deg, #14b8a6, #0d9488); border-color: rgba(20,184,166,0.5); color: #fff; box-shadow: 0 0 20px rgba(20,184,166,0.2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 25px rgba(20,184,166,0.4); border-color: #2dd4bf; }
.btn-secondary { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.1); color: #e2e8f0; }
.btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: #fff; transform: translateY(-1px); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.modal-bg {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.secret-blur {
    filter: blur(6px);
    transition: filter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.secret-blur:hover {
    filter: blur(0);
}

.gateway-card {
    background: linear-gradient(180deg, #0f1729 0%, #0b1120 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gateway-card:hover {
    border-color: rgba(20, 184, 166, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(20, 184, 166, 0.1);
}

/* Fix for WebKit autofill causing white background */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0f172a inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 5. Badges, Buttons & Interactive Elements */
.badge-active {
    background: rgba(20, 184, 166, 0.1);
    color: #2dd4bf;
}
.badge-blocked {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}
.badge-new {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
}
.tab-btn {
    transition: all 0.15s ease-in-out;
}
.tab-btn.active {
    background: rgba(20, 184, 166, 0.12);
    color: #2dd4bf;
    border-color: rgba(20, 184, 166, 0.3);
}
.copy-btn {
    transition: all 0.15s ease-in-out;
}
.copy-btn.copied {
    color: #2dd4bf;
}

/* Tooltip and Flash Micro-interactions */
.tooltip { position: relative; }
.tooltip::after {
    content: attr(data-tip);
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: #e2e8f0; padding: 4px 8px; border-radius: 6px;
    font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none;
    transition: opacity 0.15s ease; z-index: 50; border: 1px solid rgba(255,255,255,0.1);
}
.tooltip:hover::after { opacity: 1; }
.key-flash { animation: flash 0.3s ease; }
@keyframes flash { 0%, 100% { background-color: transparent; } 50% { background-color: rgba(20, 184, 166, 0.1); } }

/* Code Syntax Highlighting Tokens */
.token { color: #818CF8; }
.string { color: #A7F3D0; }
.keyword { color: #F472B6; }
.comment { color: #9CA3AF; }

/* 6. Standard Animations & Content Typography */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.delay-100 {
    animation-delay: 100ms;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 0.3s ease-out forwards; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fade-in { animation: fadeIn 0.2s ease; }

/* Dynamic HTML Content Typography (Legal & Markdown) */
.custom-html h1 { font-size: 2.25rem; font-weight: 800; color: white; margin-bottom: 1rem; }
.custom-html h2 { font-size: 1.5rem; font-weight: 700; color: white; margin-top: 2rem; margin-bottom: 1rem; }
.custom-html h3 { font-size: 1.25rem; font-weight: 600; color: white; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.custom-html p { margin-bottom: 1rem; line-height: 1.625; }
.custom-html ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; color: #9ca3af; }
.custom-html a { color: #2dd4bf; text-decoration: underline; }

/* 7. Vertical Navigation Layout Offsets */
@media (min-width: 768px) {
    body.has-sidebar,
    body:has(nav.fixed) {
        padding-left: 4.5rem; /* 72px sidebar */
    }
}
@media (max-width: 767px) {
    body.has-sidebar,
    body:has(nav.fixed) {
        padding-bottom: 4.5rem; /* 72px bottom bar */
    }
}

/* 8. Global Safeguards for Dynamic Elements */
.app-card-logo-frame {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}
.app-card-logo-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Global Hidden & Modal Safeguards */
.hidden,
[hidden],
.modal-overlay.hidden,
.pqc-modal-overlay.hidden {
    display: none !important;
}

/* Sidebar Hover Label Transitions */
nav.group\/sidebar:hover span,
nav:hover span,
aside.inner-sidebar-layout:hover span,
aside.inner-sidebar-layout:hover div {
    opacity: 1 !important;
}



