/* ============================================
   SZKTool Admin Panel - Dark Theme CSS
   ============================================ */

:root {
    --bg-dark: #11111B;
    --bg-card: #1E1E2E;
    --bg-card-alt: #282840;
    --bg-sidebar: #181825;
    --bg-input: #1E1E2E;
    --border-color: #313244;
    --text-primary: #CDD6F4;
    --text-secondary: #A6ADC8;
    --text-muted: #6C7086;
    --accent: #6C5CE7;
    --accent-hover: #7C6FF7;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --teal: #00CEC9;
    --teal-hover: #00E5DF;
    --success: #A6E3A1;
    --warning: #F9E2AF;
    --danger: #F38BA8;
    --info: #89B4FA;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --transition-speed: 0.2s;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Base ---- */
html {
    font-size: 14px;
    min-height: 100%;
    position: relative;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-hover);
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform var(--transition-speed);
}

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

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.sidebar-brand .brand-text span {
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 8px 12px 6px;
    margin-top: 8px;
}

.sidebar-nav .nav-item {
    margin-bottom: 2px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-primary);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(108, 92, 231, 0.1));
    color: var(--accent);
    font-weight: 600;
}

.sidebar-nav .nav-link.active i {
    color: var(--accent);
}

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

.sidebar-footer .btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.sidebar-footer .btn-logout:hover {
    background: rgba(243, 139, 168, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* ============================================
   Top Bar
   ============================================ */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: rgba(17, 17, 27, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 1030;
}

.topbar .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
}

.topbar .user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.topbar .user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 28px;
    min-height: 100vh;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: box-shadow var(--transition-speed), transform var(--transition-speed);
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card-header {
    background: var(--bg-card-alt);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* ============================================
   Tables
   ============================================ */
.table-dark-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-dark-custom thead th {
    background: var(--bg-card-alt);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table-dark-custom thead th:first-child {
    border-radius: 8px 0 0 0;
}

.table-dark-custom thead th:last-child {
    border-radius: 0 8px 0 0;
}

.table-dark-custom tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
    font-size: 0.9rem;
}

.table-dark-custom tbody tr {
    transition: background var(--transition-speed);
}

.table-dark-custom tbody tr:hover {
    background: rgba(108, 92, 231, 0.05);
}

.table-dark-custom tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   Avatar
   ============================================ */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.avatar-purple { background: linear-gradient(135deg, #6C5CE7, #A29BFE); }
.avatar-teal { background: linear-gradient(135deg, #00CEC9, #55EFC4); }
.avatar-pink { background: linear-gradient(135deg, #FD79A8, #E84393); }
.avatar-blue { background: linear-gradient(135deg, #74B9FF, #0984E3); }
.avatar-orange { background: linear-gradient(135deg, #FDCB6E, #E17055); }

/* ============================================
   Badges
   ============================================ */
.badge-role {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-admin {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
    border: 1px solid rgba(108, 92, 231, 0.3);
}

.badge-user {
    background: rgba(0, 206, 201, 0.15);
    color: var(--teal);
    border: 1px solid rgba(0, 206, 201, 0.3);
}

.badge-moderator {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.badge-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: rgba(166, 227, 161, 0.15);
    color: var(--success);
    border: 1px solid rgba(166, 227, 161, 0.3);
}

.badge-inactive {
    background: rgba(243, 139, 168, 0.15);
    color: var(--danger);
    border: 1px solid rgba(243, 139, 168, 0.3);
}

/* ============================================
   Buttons
   ============================================ */
.btn-accent {
    background: linear-gradient(135deg, var(--accent), #7C6FF7);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #7C6FF7, #8B7FF7);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-accent:active {
    transform: translateY(0);
}

.btn-teal {
    background: linear-gradient(135deg, var(--teal), #00E5DF);
    color: #11111B;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.btn-teal:hover {
    background: linear-gradient(135deg, #00E5DF, #55EFC4);
    color: #11111B;
    transform: translateY(-1px);
}

.btn-outline-custom {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.btn-outline-custom:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(108, 92, 231, 0.05);
}

.btn-danger-soft {
    background: rgba(243, 139, 168, 0.1);
    color: var(--danger);
    border: 1px solid rgba(243, 139, 168, 0.2);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all var(--transition-speed);
}

.btn-danger-soft:hover {
    background: rgba(243, 139, 168, 0.2);
    color: var(--danger);
    border-color: var(--danger);
}

.btn-edit {
    background: rgba(108, 92, 231, 0.1);
    color: var(--accent);
    border: 1px solid rgba(108, 92, 231, 0.2);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all var(--transition-speed);
}

.btn-edit:hover {
    background: rgba(108, 92, 231, 0.2);
    color: var(--accent);
    border-color: var(--accent);
}

/* ============================================
   Forms
   ============================================ */
.form-control,
.form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-input);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.form-check-input {
    background-color: var(--bg-card-alt);
    border-color: var(--border-color);
    width: 1.1em;
    height: 1.1em;
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--accent-glow);
    border-color: var(--accent);
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.3em;
}

.form-switch .form-check-input:checked {
    background-color: var(--accent);
}

/* ============================================
   Search Box
   ============================================ */
.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box .form-control {
    padding-left: 40px;
}

/* ============================================
   Platform Feature Checkboxes
   ============================================ */
.feature-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.feature-check:hover {
    border-color: var(--text-muted);
}

.feature-check.checked {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.05);
}

.feature-check .platform-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.platform-youtube { background: #FF0000; }
.platform-twitter { background: #1DA1F2; }
.platform-instagram { background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF); }
.platform-facebook { background: #1877F2; }
.platform-tiktok { background: #010101; border: 1px solid #333; }
.platform-reddit { background: #FF4500; }
.platform-pinterest { background: #E60023; }

.feature-check .platform-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Format badges */
.format-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all var(--transition-speed);
    cursor: pointer;
    margin: 3px;
}

.format-check:hover {
    border-color: var(--text-muted);
}

.format-check.checked {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.08);
}

.format-check .format-label {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.format-group-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.format-group-title i {
    color: var(--accent);
}

/* ============================================
   Login Page
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #11111B 0%, #1a1a2e 50%, #16213e 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(0, 206, 201, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .brand-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 16px;
}

.login-brand h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-brand h1 span {
    color: var(--accent);
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-card .btn-accent {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

/* ============================================
   Alerts
   ============================================ */
.alert-custom {
    background: rgba(243, 139, 168, 0.1);
    border: 1px solid rgba(243, 139, 168, 0.25);
    color: var(--danger);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
}

.alert-success-custom {
    background: rgba(166, 227, 161, 0.1);
    border: 1px solid rgba(166, 227, 161, 0.25);
    color: var(--success);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
}

/* ============================================
   Stat Cards (Dashboard)
   ============================================ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.stat-icon-purple {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
}

.stat-icon-teal {
    background: rgba(0, 206, 201, 0.15);
    color: var(--teal);
}

.stat-icon-pink {
    background: rgba(243, 139, 168, 0.15);
    color: var(--danger);
}

.stat-icon-blue {
    background: rgba(137, 180, 250, 0.15);
    color: var(--info);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   Responsive - Mobile sidebar
   ============================================ */
.sidebar-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .topbar {
        left: 0;
    }

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

    .sidebar-toggle {
        display: inline-flex;
    }
}

/* ============================================
   Utilities
   ============================================ */
.text-accent { color: var(--accent) !important; }
.text-teal { color: var(--teal) !important; }
.bg-accent-soft { background: rgba(108, 92, 231, 0.1); }
.border-accent { border-color: var(--accent) !important; }

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Validation */
.field-validation-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

.input-validation-error {
    border-color: var(--danger) !important;
}

.validation-summary-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.validation-summary-errors ul li {
    color: var(--danger);
    font-size: 0.85rem;
    padding: 2px 0;
}

/* ---- Feature Cards (Edit User) ---- */
.feature-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card-alt);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.feature-card:hover {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.05);
}

.feature-card.active {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.1);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ---- Format Badges (Edit User) ---- */
.format-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--bg-card-alt);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
    user-select: none;
}

.format-badge:hover {
    border-color: var(--accent);
}

.format-badge.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
}
