/* ============================================
   AFFILIATE ADMIN PANEL - PROFESSIONAL STYLES
   Extends: /shared/css/brand.css (dark neon theme)
   ============================================ */

:root {
    /* Affiliates variable names — mapped to brand.css for consistency */
    --bg-primary:          var(--color-bg-main, #050A1F);
    --bg-secondary:        var(--color-bg-panel, #0A1030);
    --bg-tertiary:         var(--color-bg-elevated, #0D1540);
    --text-primary:        var(--color-text, #FFFFFF);
    --text-secondary:      var(--color-text-secondary, #A0A8C0);
    --text-muted:          var(--color-text-muted, #5A6282);
    --text-light:          var(--color-text, #FFFFFF);
    --border-light:        var(--color-border, rgba(0, 229, 255, 0.12));
    --border-color:        var(--color-border, rgba(0, 229, 255, 0.12));
    --border-card:         rgba(255, 79, 216, 0.2);
    --primary:             var(--color-primary, #FF4FD8);
    --accent-pink:         var(--color-primary, #FF4FD8);
    --accent-light-pink:   var(--color-primary-end, #E056FD);
    --accent-purple:       var(--color-primary-end, #E056FD);
    --accent-blue:         var(--color-accent, #00E5FF);
    --accent-green:        var(--color-success, #00E5B0);
    --accent-orange:       var(--color-warning, #FFB347);
    --accent-red:          var(--color-error, #FF4F6D);
    --card-shadow:         var(--shadow-card, 0 4px 32px rgba(0, 0, 0, 0.5));
    --card-shadow-hover:   var(--shadow-card-hover, 0 8px 40px rgba(0, 0, 0, 0.6));
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

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

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 0;
    box-shadow: 0 2px 12px var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.navbar-brand span {
    color: var(--accent-pink);
}

.navbar-nav {
    display: flex;
    gap: 0;
    align-items: center;
    flex: 1;
    margin-left: 40px;
}

.navbar-nav a {
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    height: 64px;
    white-space: nowrap;
}

.navbar-nav a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-pink);
}

.navbar-nav a.active {
    color: var(--accent-pink);
    border-bottom-color: var(--accent-pink);
}

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

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--border-light);
    transform: scale(1.05);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-light-pink) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 46, 146, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(255, 46, 146, 0.35);
}

.btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-blue);
}

.btn-info {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-info:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============================================
   CONTAINER & SECTIONS
   ============================================ */

.section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title-icon {
    font-size: 1.5rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--card-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px var(--card-shadow-hover);
    transform: translateY(-2px);
}

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

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

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.card-body {
    color: var(--text-secondary);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 16px var(--card-shadow-hover);
    transform: translateY(-4px);
}

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

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-5 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
    .grid-5 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 14px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--accent-green);
    color: var(--accent-green);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--accent-red);
    color: var(--accent-red);
}

.alert-warning {
    background: rgba(249, 115, 22, 0.1);
    border-left-color: var(--accent-orange);
    color: var(--accent-orange);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--accent-blue);
    color: var(--accent-blue);
}

.alert-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

thead {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-light);
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

tbody tr:hover {
    background: var(--bg-tertiary);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.status-suspended {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.status-banned {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.status-pending {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

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

.modal-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* ============================================
   HELP SECTION
   ============================================ */

.help-section {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.help-section h3 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.help-section p {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section strong {
    color: var(--text-primary);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-light {
    color: var(--text-light);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .navbar-nav {
        display: none;
    }

    .navbar-wrap {
        padding: 0 16px;
    }

    .section {
        padding: 24px 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.25rem;
    }

    .stat-card-value {
        font-size: 2rem;
    }

    table {
        font-size: 0.9rem;
    }

    th,
    td {
        padding: 10px 12px;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 16px 12px;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .card {
        padding: 1rem;
    }

    .stat-card-value {
        font-size: 1.75rem;
    }

    .btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .modal-content {
        padding: 1.25rem;
    }
}
