/**
 * StyleNexus Dashboard Styles
 * Shared across Beta, Affiliate, and Tenant dashboards
 */

/* CSS Variables - Dark Mode */
:root {
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --secondary: #EC4899;

    /* Dark mode colors */
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-elevated: #1a1a24;
    --bg-input: #1e1e2a;

    --dark: #0a0a0f;
    --gray-900: #f8fafc;
    --gray-800: #e2e8f0;
    --gray-700: #cbd5e1;
    --gray-600: #94a3b8;
    --gray-500: #64748b;
    --gray-400: #475569;
    --gray-300: #334155;
    --gray-200: #2a2a3a;
    --gray-100: #1a1a24;
    --gray-50: #12121a;
    --white: #12121a;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2a2a3a;

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-width: 260px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    background: var(--bg-dark);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-beta {
    background: var(--primary);
    color: var(--white);
}

.badge-affiliate {
    background: var(--success);
    color: var(--white);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--gray-600);
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: #ffffff;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.nav-section-title {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-400);
    letter-spacing: 0.5px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details strong {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details span {
    font-size: 12px;
    color: var(--gray-500);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-header {
    background: var(--bg-card);
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.content-body {
    padding: 32px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.card-intro {
    margin-bottom: 24px;
}

.card-intro h3 {
    margin-bottom: 8px;
}

.card-intro p {
    color: var(--gray-600);
}

/* Status Card */
.card-status {
    text-align: center;
    padding: 40px 24px;
}

.card-status h2 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-status > p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.status-success {
    background: #D1FAE5;
    color: #059669;
}

.status-warning {
    background: #FEF3C7;
    color: #D97706;
}

.status-primary {
    background: #EDE9FE;
    color: #7C3AED;
}

.status-message {
    background: var(--bg-elevated);
    padding: 20px;
    border-radius: var(--radius);
    margin-top: 20px;
}

.status-message.success {
    background: #D1FAE5;
}

.status-message p {
    margin-bottom: 16px;
}

/* Success Card */
.card-success {
    text-align: center;
    padding: 48px 24px;
}

.card-success .success-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
}

.card-success h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-success p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Perks Grid */
.perks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.perk-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
}

.perk-icon {
    font-size: 24px;
}

.perk-content strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.perk-content span {
    font-size: 13px;
    color: var(--gray-500);
}

/* Feedback List */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
}

.feedback-type {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.type-bug { background: #FEE2E2; color: #DC2626; }
.type-feature { background: #DBEAFE; color: #2563EB; }
.type-improvement { background: #FEF3C7; color: #D97706; }
.type-praise { background: #D1FAE5; color: #059669; }
.type-other { background: var(--gray-200); color: var(--gray-600); }

.feedback-content {
    flex: 1;
    min-width: 0;
}

.feedback-content strong {
    display: block;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feedback-date {
    font-size: 12px;
    color: var(--gray-400);
}

.feedback-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.status-new { background: #DBEAFE; color: #2563EB; }
.status-reviewed { background: #FEF3C7; color: #D97706; }
.status-implemented { background: #D1FAE5; color: #059669; }
.status-wontfix { background: var(--gray-200); color: var(--gray-600); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state p {
    margin-bottom: 16px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

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

/* Type Selector */
.type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.type-option input {
    display: none;
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.type-option input:checked + .type-card {
    border-color: var(--primary);
    background: #EDE9FE;
}

.type-icon {
    font-size: 24px;
}

.type-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-700);
    text-align: center;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #D1FAE5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.alert-warning {
    background: #FEF3C7;
    color: #D97706;
    border: 1px solid #FCD34D;
}

.alert-info {
    background: #DBEAFE;
    color: #2563EB;
    border: 1px solid #93C5FD;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-change {
    font-size: 13px;
    margin-top: 8px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--error);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 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: 0.5px;
    background: var(--bg-elevated);
}

td {
    font-size: 14px;
    color: var(--text-secondary);
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-header {
        padding: 16px 20px;
    }

    .content-body {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .perks-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Logo Image */
.sidebar-logo {
    height: 40px;
    width: auto;
    max-width: 180px;
}

.logo .sidebar-logo {
    filter: brightness(0) invert(1);
}
