/* XO Development - Master Stylesheet
   Complete unified styling for all pages
   Last updated: Feb 2026 */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff;
    background: linear-gradient(135deg, #0a0a0f 0%, #0d0d14 50%, #0a0a0f 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

a {
    color: #d4a039;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #e8b84a;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   COLOR VARIABLES (CSS Custom Properties)
   ============================================ */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0d0d14;
    --bg-card: #0d0d14;
    --bg-input: #1a1a2e;
    --border-color: #1a1a2e;
    --border-light: #333;
    --gold: #d4a039;
    --gold-hover: #e8b84a;
    --gold-dim: rgba(212, 160, 57, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #666666;
    --danger: #ff6b6b;
    --success: #4ade80;
    --header-height: 80px;
    --sidebar-width: 280px;
}

/* ============================================
   PUBLIC HEADER (.xo-header)
   ============================================ */
.xo-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
}

.xo-header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

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

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

.xo-header-brand-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.xo-header-brand-tagline {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

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

.xo-header-nav a {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

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

.xo-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */
.xo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    white-space: nowrap;
}

.xo-btn-primary {
    background: var(--gold);
    color: #000;
}

.xo-btn-primary:hover {
    background: var(--gold-hover);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212, 160, 57, 0.3);
}

.xo-btn-secondary,
.xo-btn-outline {
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold);
}

.xo-btn-secondary:hover,
.xo-btn-outline:hover {
    background: var(--gold-dim);
    color: var(--gold);
}

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

.xo-btn-danger:hover {
    background: #ff5252;
}

button, .btn {
    cursor: pointer;
}

/* ============================================
   MOBILE MENU BUTTON
   ============================================ */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ============================================
   MOBILE MENU DROPDOWN
   ============================================ */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    flex-direction: column;
    gap: 0;
    z-index: 999;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

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

.mobile-menu a {
    display: block;
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.mobile-menu a:hover {
    background: var(--gold-dim);
    color: var(--gold);
}

/* ============================================
   PORTAL SIDEBAR
   ============================================ */
.portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 100;
    overflow-y: auto;
}

.portal-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 24px 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    text-decoration: none;
}

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

.portal-sidebar-brand span {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
}

.portal-sidebar-section {
    margin-bottom: 24px;
}

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

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

.portal-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.portal-sidebar-nav a:hover {
    background: var(--gold-dim);
    color: var(--text-primary);
}

.portal-sidebar-nav a.active {
    background: var(--gold);
    color: #000;
}

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

/* ============================================
   PORTAL MAIN CONTENT
   ============================================ */
.portal-main {
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    min-height: 100vh;
}

/* ============================================
   PORTAL MOBILE HEADER
   ============================================ */
.portal-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 101;
}

.portal-mobile-header img {
    height: 35px;
}

.portal-mobile-header span {
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
}

.sidebar-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    justify-content: center;
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
}

/* ============================================
   FORM INPUTS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

input:focus,
textarea:focus,
select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 160, 57, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 20px;
}

/* ============================================
   CARDS
   ============================================ */
.card, .xo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover, .xo-card:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 30px rgba(212, 160, 57, 0.1);
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.stat-card h3, .stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 8px;
}

.stat-card p, .stat-card .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

tr:hover td {
    background: rgba(212, 160, 57, 0.05);
}

/* ============================================
   COPY BUTTONS
   ============================================ */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--gold);
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--gold-dim);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero, .hero-section {
    text-align: center;
    padding: 120px 20px 80px;
}

.hero h1, .hero-section h1 {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero h2, .hero-section h2 {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.hero p, .hero-section p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

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

/* ============================================
   SECTIONS
   ============================================ */
section {
    padding: 80px 40px;
}

section h2 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-gold { color: var(--gold) !important; }
.text-muted { color: var(--text-secondary) !important; }
.text-danger { color: var(--danger) !important; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-4 { margin-top: 32px !important; }

/* ============================================
   PAGE CONTENT WRAPPER (for pages with header)
   ============================================ */
.page-content {
    padding-top: calc(var(--header-height) + 40px);
    padding-left: 40px;
    padding-right: 40px;
    min-height: 100vh;
}

/* ============================================
   RESPONSIVE: TABLET (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .xo-header {
        padding: 0 24px;
    }
    
    .xo-header-nav {
        gap: 20px;
    }
    
    .portal-sidebar {
        width: 240px;
    }
    
    .portal-main {
        margin-left: 240px;
        padding: 24px;
    }
    
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    
    section {
        padding: 60px 24px;
    }
}

/* ============================================
   RESPONSIVE: MOBILE (< 768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    /* PUBLIC HEADER MOBILE */
    .xo-header {
        padding: 0 16px;
    }
    
    .xo-header-brand img {
        height: 45px;
    }
    
    .xo-header-brand-name {
        font-size: 18px;
    }
    
    .xo-header-brand-tagline {
        display: none;
    }
    
    .xo-header-nav {
        display: none !important;
    }
    
    .xo-header-actions {
        display: none !important;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    /* PORTAL MOBILE */
    .portal-sidebar {
        position: fixed;
        left: -100%;
        width: 280px;
        transition: left 0.3s ease;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 999;
    }
    
    .portal-sidebar.active {
        left: 0;
    }
    
    .portal-mobile-header {
        display: flex !important;
    }
    
    .portal-main {
        margin-left: 0;
        padding: 80px 16px 24px 16px;
    }
    
    /* GRIDS */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* SECTIONS */
    section {
        padding: 40px 16px;
    }
    
    section h2 {
        font-size: 24px;
        margin-bottom: 32px;
    }
    
    /* HERO */
    .hero, .hero-section {
        padding: 100px 16px 60px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .xo-btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* FORMS */
    input, textarea, select {
        padding: 12px 14px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* TABLES */
    table {
        display: block;
        overflow-x: auto;
    }
    
    th, td {
        padding: 12px;
        font-size: 14px;
    }
    
    /* PAGE CONTENT */
    .page-content {
        padding: calc(var(--header-height) + 24px) 16px 24px;
    }
}

/* ============================================
   OVERLAY FOR MOBILE MENUS
   ============================================ */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
}

.overlay.active {
    display: block;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-info {
    background: var(--gold-dim);
    border: 1px solid var(--gold);
    color: var(--gold);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 40px;
    text-align: center;
}

footer p {
    color: var(--text-muted);
    font-size: 14px;
}

@media (max-width: 768px) {
    footer {
        padding: 40px 16px;
    }
}
