/* ==========================================================================
   ATPIQuery Design System
   Dark Theme with Strong Purple / Violet Accents & Local Oxygen Typography
   CRITICAL CONSTRAINT: 0% Blue (No blue tones anywhere)
   ========================================================================== */

@font-face {
    font-family: 'Oxygen';
    src: url('../font/Oxygen/Oxygen.woff2') format('woff2'),
         url('../font/Oxygen/Oxygen-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Oxygen';
    src: url('../font/Oxygen/Oxygen-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Oxygen';
    src: url('../font/Oxygen/Oxygen-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Base Obsidian & Plum Dark Surfaces */
    --bg-base: #08070d;
    --bg-surface: #100c1c;
    --bg-card: #161124;
    --bg-card-hover: #1e1733;
    --bg-elevated: #241b3d;
    --bg-glass: rgba(16, 12, 28, 0.75);
    
    /* Strong Purple & Violet Accent Palette (Zero Blue) */
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-200: #e9d5ff;
    --purple-300: #d8b4fe;
    --purple-400: #c084fc;
    --purple-500: #a855f7;
    --purple-600: #8b5cf6;
    --purple-700: #7c3aed;
    --purple-800: #6d28d9;
    --purple-900: #581c87;
    --purple-950: #2e0854;

    /* Semantic States (Strictly NO BLUE) */
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-error: #f43f5e;
    --color-error-bg: rgba(244, 63, 94, 0.12);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.12);

    /* Text & Borders */
    --text-primary: #fdfcff;
    --text-secondary: #cbbbd9;
    --text-muted: #8b799e;
    --border-subtle: #2a1f45;
    --border-card: #37285c;
    --border-glow: rgba(139, 92, 246, 0.45);

    /* Shadows & Glows */
    --glow-sm: 0 0 15px rgba(124, 58, 237, 0.25);
    --glow-md: 0 0 30px rgba(124, 58, 237, 0.35);
    --glow-lg: 0 0 50px rgba(139, 92, 246, 0.45);
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);

    /* Radius & Transitions */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Global Elements */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Oxygen', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Smooth Background Ambient Gradient */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: 20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, rgba(88, 28, 135, 0.04) 50%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

a {
    color: var(--purple-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--purple-300);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--purple-700);
}

/* Top Navigation Bar */
.atpi-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.atpi-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.atpi-brand-badge {
    background: linear-gradient(135deg, var(--purple-600), var(--purple-800));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--glow-sm);
}

.atpi-nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.atpi-nav-item {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.atpi-nav-item:hover, .atpi-nav-item.active {
    color: var(--purple-300);
    background: rgba(124, 58, 237, 0.08);
}

.atpi-admin-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--purple-900), var(--bg-elevated));
    border: 1px solid var(--purple-500);
    border-radius: 50%;
    color: var(--purple-300);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.atpi-admin-shortcut:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.7);
    color: #fff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-600), var(--purple-800));
    color: #fff;
    box-shadow: var(--glow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
    box-shadow: var(--glow-md);
    transform: translateY(-2px);
    color: #fff;
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--purple-600);
    color: var(--purple-300);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--color-error);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: var(--color-error);
    color: #fff;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Main Layout Container */
.atpi-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1;
}

/* Hero Section */
.hero-section {
    padding: 5rem 1rem 4rem;
    text-align: center;
    position: relative;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid var(--border-glow);
    font-size: 0.85rem;
    color: var(--purple-300);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 40%, var(--purple-300) 80%, var(--purple-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 760px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Cards & Grids */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--purple-600);
    box-shadow: var(--glow-sm);
    transform: translateY(-3px);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(124, 58, 237, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--purple-400);
    margin-bottom: 1.25rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Interactive Code Tabs */
.code-box {
    background: #090710;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: var(--shadow-card);
}

.code-header {
    background: var(--bg-surface);
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-tabs {
    display: flex;
    gap: 0.5rem;
}

.code-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.code-tab.active, .code-tab:hover {
    color: var(--purple-300);
    background: rgba(124, 58, 237, 0.15);
}

.code-body {
    padding: 1.25rem;
    overflow-x: auto;
}

.code-body pre {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e2d9f3;
    line-height: 1.6;
    margin: 0;
}

/* Pricing / Packages Table Cards */
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-smooth);
    position: relative;
}

.pricing-card.featured {
    border-color: var(--purple-500);
    box-shadow: var(--glow-md);
    background: linear-gradient(180deg, rgba(30, 23, 51, 0.9) 0%, var(--bg-card) 100%);
}

.pricing-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--purple-600);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.pricing-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pricing-limit {
    font-size: 2rem;
    font-weight: 700;
    color: var(--purple-300);
    margin: 1rem 0;
}

.pricing-limit small {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    margin: 1.5rem 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.pricing-features li span.check {
    color: var(--purple-400);
    font-weight: 700;
}

/* KPI Stat Cards (Dashboard) */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Progress Bar */
.progress-bar-wrap {
    background: var(--bg-surface);
    border-radius: 9999px;
    height: 10px;
    overflow: hidden;
    margin: 0.75rem 0;
    border: 1px solid var(--border-subtle);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple-600), var(--purple-400));
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Data Table */
.data-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 1.5rem 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background: var(--bg-surface);
    padding: 0.85rem 1.25rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(42, 31, 69, 0.4);
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: rgba(124, 58, 237, 0.04);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-purple {
    background: rgba(124, 58, 237, 0.15);
    color: var(--purple-300);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--purple-500);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: 'Consolas', monospace;
}

/* Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 7, 13, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

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

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    padding: 2rem;
    box-shadow: var(--shadow-card), var(--glow-md);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

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

/* Footer */
.atpi-footer {
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    padding: 2.5rem 2rem;
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }
    .atpi-nav {
        padding: 0.75rem 1rem;
    }
    .atpi-container {
        padding: 1rem;
    }
    .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}
