/* Portal & Launcher Global Stylesheet - High Density & Compact Viewport */
:root {
    --bg-main: #090d16;
    --bg-card: rgba(18, 24, 38, 0.85);
    --bg-card-hover: rgba(26, 35, 55, 0.95);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    --accent: #ec4899;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    font-size: 13px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Container */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Header & Navbar */
.site-nav {
    background: rgba(9, 13, 22, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-logo .logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.brand-logo span span {
    background: linear-gradient(135deg, #818cf8, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-ghost {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 10px var(--primary-glow);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

/* Hero Section */
.hero-section {
    padding: 16px 0 10px;
    text-align: center;
    position: relative;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 3px 12px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 8px;
}

.hero-title {
    font-size: clamp(1.4rem, 3.2vw, 2.1rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.hero-title .gradient-text {
    background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 12px;
    line-height: 1.4;
}

/* Stats Counter Row */
.stats-banner {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

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

.stat-val {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1px;
}

.stat-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Filter & Search Bar */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    backdrop-filter: blur(12px);
    flex-wrap: wrap;
}

.search-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.search-wrap input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px 6px 32px;
    color: #fff;
    font-size: 0.8rem;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
}

.search-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.search-wrap svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 14px;
    height: 14px;
}

.category-tags {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    max-width: 100%;
}

.cat-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cat-btn:hover, .cat-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 420px) {
    .apps-grid {
        grid-template-columns: 1fr;
    }
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.2s;
}

.app-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.4);
}

.app-card:hover::before {
    opacity: 1;
}

.app-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.app-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge-active { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-pin { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-maintenance { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.app-title {
    font-size: 0.98rem;
    font-weight: 800;
    margin-bottom: 2px;
    color: #fff;
}

.app-category {
    font-size: 0.72rem;
    color: #38bdf8;
    font-weight: 600;
    margin-bottom: 8px;
}

.app-desc {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.38;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Credentials Box on Card */
.cred-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 12px;
}

.cred-box-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.cred-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 8px;
    border-radius: 4px;
}

.cred-item:last-child {
    margin-bottom: 0;
}

.cred-role {
    font-weight: 600;
    color: #cbd5e1;
}

.cred-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    color: #a5b4fc;
    font-size: 0.75rem;
}

.copy-mini-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 1px 3px;
    border-radius: 3px;
    transition: 0.2s;
}

.copy-mini-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.card-footer-actions {
    display: flex;
    gap: 8px;
}

.btn-launch {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    text-decoration: none;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-launch:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 16px 0;
    margin-top: auto;
    background: rgba(9, 13, 22, 0.9);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Floating Toast Notification */
.toast-notice {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: #1e293b;
    color: #fff;
    border: 1px solid var(--border-hover);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    gap: 6px;
    z-index: 9999;
}

.toast-notice.show {
    display: flex;
}

/* Modal Box */
.modal-wrapper {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    backdrop-filter: blur(6px);
}

.modal-wrapper.active {
    display: flex;
}

.modal-card {
    background: #131b2e;
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 380px;
    width: 100%;
    padding: 20px;
    text-align: center;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}

.modal-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.modal-card p {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-bottom: 14px;
}

.pin-input {
    width: 100%;
    background: #0b0f19;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    font-size: 1.2rem;
    letter-spacing: 0.25em;
    text-align: center;
    color: #fff;
    outline: none;
    margin-bottom: 14px;
    font-family: monospace;
    box-sizing: border-box;
}

.pin-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
