/* XO DEVELOPMENT - UNIFIED DESIGN SYSTEM v3.0 */
/* Single source of truth for ALL styling */

/* ========================================
   CSS VARIABLES - Premium Metallic Gold
   ======================================== */
:root {
    /* Premium Gold - Metallic/Amber tones */
    --xo-gold: #D4A84B;
    --xo-gold-light: #E8C872;
    --xo-gold-dark: #B8912F;
    --xo-gold-gradient: linear-gradient(135deg, #D4A84B 0%, #E8C872 50%, #D4A84B 100%);
    --xo-gold-metallic: linear-gradient(135deg, #B8912F 0%, #D4A84B 25%, #E8C872 50%, #D4A84B 75%, #B8912F 100%);
    
    /* Backgrounds */
    --xo-bg-dark: #0d0d0d;
    --xo-bg-card: #141414;
    --xo-bg-card-hover: #1a1a1a;
    --xo-bg-input: #1a1a1a;
    
    /* Text */
    --xo-text: #ffffff;
    --xo-text-muted: #888888;
    --xo-text-dim: #666666;
    
    /* Borders */
    --xo-border: rgba(212, 168, 75, 0.2);
    --xo-border-hover: rgba(212, 168, 75, 0.4);
    
    /* Spacing */
    --xo-header-height: 70px;
    --xo-sidebar-width: 260px;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--xo-bg-dark);
    color: var(--xo-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========================================
   UNIVERSAL HEADER (Public Pages)
   ======================================== */
.xo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: var(--xo-header-height);
    background: rgba(13, 13, 13, 0.95);
    border-bottom: 1px solid var(--xo-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

/* Header Brand - Logo + Text */
.xo-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.xo-header-brand img {
    height: 45px;
    width: auto;
}

.xo-header-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.xo-header-brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    background: var(--xo-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.xo-header-brand-tagline {
    font-size: 10px;
    color: var(--xo-gold);
    letter-spacing: 2px;
    opacity: 0.8;
}

/* Header Navigation */
.xo-header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.xo-header-nav a {
    color: var(--xo-text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.xo-header-nav a:hover,
.xo-header-nav a.active {
    color: var(--xo-gold);
}

/* Header Actions - Buttons */
.xo-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========================================
   BUTTONS - Universal Styles
   ======================================== */
.xo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

/* Primary Button - Solid Gold */
.xo-btn-primary {
    background: var(--xo-gold-gradient);
    color: #000;
    border: none;
}

.xo-btn-primary:hover {
    background: var(--xo-gold-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 168, 75, 0.3);
}

/* Secondary Button - Outline */
.xo-btn-secondary,
.xo-btn-outline {
    background: transparent;
    color: var(--xo-gold);
    border: 1px solid var(--xo-gold);
}

.xo-btn-secondary:hover,
.xo-btn-outline:hover {
    background: rgba(212, 168, 75, 0.1);
    border-color: var(--xo-gold-light);
}

/* Wallet Button - Special styling */
#xoWalletBtn {
    background: rgba(26, 26, 26, 0.8);
    color: var(--xo-gold);
    border: 1px solid var(--xo-gold);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#xoWalletBtn:hover {
    background: rgba(212, 168, 75, 0.15);
    border-color: var(--xo-gold-light);
}

/* ========================================
   PORTAL SIDEBAR (Logged-in Pages)
   ======================================== */
.portal-container {
    display: flex;
    min-height: 100vh;
}

.portal-sidebar {
    width: var(--xo-sidebar-width);
    background: var(--xo-bg-card);
    border-right: 1px solid var(--xo-border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

/* Portal Sidebar Brand */
.portal-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--xo-border);
    margin-bottom: 20px;
}

.portal-sidebar-brand img {
    height: 40px;
    width: auto;
}

.portal-sidebar-brand span {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    background: var(--xo-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Portal Navigation Sections */
.portal-sidebar-section {
    padding: 0 12px;
    margin-bottom: 20px;
}

.portal-sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--xo-text-dim);
    letter-spacing: 1px;
    padding: 0 8px;
    margin-bottom: 8px;
}

.portal-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--xo-text-muted);
    transition: all 0.2s;
}

.portal-sidebar-nav a:hover {
    background: rgba(212, 168, 75, 0.1);
    color: var(--xo-text);
}

.portal-sidebar-nav a.active {
    background: rgba(212, 168, 75, 0.15);
    color: var(--xo-gold);
}

.portal-sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Portal Main Content */
.portal-main {
    flex: 1;
    margin-left: var(--xo-sidebar-width);
    padding: 30px;
    min-height: 100vh;
}

/* ========================================
   CARDS - Stat cards, API cards, etc.
   ======================================== */
.xo-card,
.stat-card,
.api-card {
    background: var(--xo-bg-card);
    border: 1px solid var(--xo-border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
}

.xo-card:hover,
.stat-card:hover {
    border-color: var(--xo-border-hover);
    background: var(--xo-bg-card-hover);
}

/* Stat Cards */
.stat-card {
    text-align: center;
}

.stat-card h3,
.stat-card .stat-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--xo-text-muted);
    margin: 0 0 12px 0;
}

.stat-card .stat-value,
.stat-card .value {
    font-size: 36px;
    font-weight: 700;
    background: var(--xo-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.stat-card .stat-subtitle,
.stat-card small {
    font-size: 12px;
    color: var(--xo-text-dim);
    margin-top: 4px;
    display: block;
}

/* ========================================
   FORMS - Inputs, Labels, etc.
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--xo-text-muted);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--xo-bg-input);
    border: 1px solid var(--xo-border);
    border-radius: 6px;
    color: var(--xo-text);
    font-size: 14px;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--xo-gold);
}

input::placeholder,
textarea::placeholder {
    color: var(--xo-text-dim);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
}

.xo-title,
.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--xo-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.xo-subtitle,
.page-subtitle {
    font-size: 15px;
    color: var(--xo-text-muted);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--xo-gold);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--xo-header-height);
    left: 0;
    right: 0;
    background: var(--xo-bg-card);
    padding: 20px;
    border-bottom: 1px solid var(--xo-border);
    z-index: 999;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 12px 0;
    color: var(--xo-text);
    border-bottom: 1px solid var(--xo-border);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

/* Tablet and below */
@media (max-width: 900px) {
    .xo-header-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .portal-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .portal-sidebar.active {
        transform: translateX(0);
    }
    
    .portal-main {
        margin-left: 0;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .xo-header {
        padding: 0 16px;
    }
    
    .xo-header-brand-text {
        display: none;
    }
    
    .xo-header-actions {
        gap: 8px;
    }
    
    .xo-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .portal-main {
        padding: 20px 16px;
    }
}

/* ========================================
   HERO SECTION (Homepage)
   ======================================== */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: radial-gradient(ellipse at center, rgba(212, 168, 75, 0.1) 0%, transparent 70%);
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--xo-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.hero p {
    font-size: 18px;
    color: var(--xo-text-muted);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   MARKETPLACE CARDS
   ======================================== */
.marketplace-grid,
.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.api-card {
    padding: 20px;
}

.api-card h3 {
    font-size: 18px;
    color: var(--xo-text);
    margin-bottom: 8px;
}

.api-card .api-category {
    font-size: 12px;
    color: var(--xo-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.api-card .api-description {
    font-size: 14px;
    color: var(--xo-text-muted);
    margin-bottom: 16px;
}

.api-card .api-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--xo-text-dim);
}

.api-card .api-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--xo-gold);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--xo-bg-card);
    border: 1px solid var(--xo-border);
    border-radius: 20px;
    color: var(--xo-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--xo-gold);
    color: #000;
    border-color: var(--xo-gold);
}

/* ========================================
   STATS ROW (Homepage)
   ======================================== */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 60px;
    padding: 40px 20px;
    flex-wrap: wrap;
}

.stats-row .stat {
    text-align: center;
}

.stats-row .stat-value {
    font-size: 36px;
    font-weight: 700;
    background: var(--xo-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-row .stat-label {
    font-size: 14px;
    color: var(--xo-text-muted);
}

/* ========================================
   PORTAL MOBILE HEADER
   ======================================== */
.portal-mobile-header {
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--xo-bg-card);
    border-bottom: 1px solid var(--xo-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.portal-mobile-header .sidebar-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.portal-mobile-header .sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--xo-gold);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.overlay.active {
    display: block;
}

/* Show mobile header only on small screens */
@media (max-width: 768px) {
    .portal-mobile-header {
        display: flex;
    }
    
    .portal-main {
        padding-top: 70px; /* Space for mobile header */
    }
}

/* Fix portal sidebar brand text visibility */
.portal-sidebar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px 20px 20px !important;
    border-bottom: 1px solid var(--xo-border) !important;
    margin-bottom: 20px !important;
    text-decoration: none !important;
}

.portal-sidebar-brand img {
    height: 40px !important;
    width: auto !important;
    flex-shrink: 0 !important;
}

.portal-sidebar-brand span {
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    background: var(--xo-gold-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    white-space: nowrap !important;
}

/* Ensure portal main content has proper margin */
.portal-main {
    margin-left: var(--xo-sidebar-width) !important;
    padding: 30px !important;
    min-height: 100vh !important;
    width: calc(100% - var(--xo-sidebar-width)) !important;
}

/* Fix dashboard title */
.dashboard-header h1,
.page-title,
h1.dashboard-title {
    font-size: 24px;
    background: var(--xo-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.dashboard-header p,
.page-subtitle {
    color: var(--xo-text-muted);
    font-size: 15px;
}

/* Portal content - using actual class names from HTML */
.main-content,
.portal-content {
    margin-left: 260px !important;
    padding: 30px !important;
    min-height: 100vh !important;
}

/* Ensure sidebar has correct width */
.portal-sidebar,
.sidebar {
    width: 260px !important;
    min-width: 260px !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    overflow-y: auto !important;
    background: var(--xo-bg-card) !important;
    border-right: 1px solid var(--xo-border) !important;
    z-index: 100 !important;
}

/* Dashboard header with visible title */
.dashboard-header h1 {
    font-size: 28px !important;
}

/* Override any conflicting inline styles */
main.main-content.portal-content {
    margin-left: 260px !important;
}
