/* ============================================================
   KOLA-X Modlishka Panel - Dark Theme
   Purple/Neon accents, glass-morphism cards
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(15, 20, 40, 0.85);
    --bg-card-hover: rgba(20, 25, 50, 0.9);
    --border-color: rgba(139, 92, 246, 0.15);
    --border-hover: rgba(139, 92, 246, 0.3);
    --text-primary: #f1f5f9;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.3);
    --accent-purple: #8b5cf6;
    --accent-purple-dark: #6d28d9;
    --accent-blue: #2563eb;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-yellow: #eab308;
    --gradient-primary: linear-gradient(135deg, #6c2bd9, #2563eb);
    --gradient-card: linear-gradient(135deg, rgba(108, 43, 217, 0.05), rgba(37, 99, 235, 0.05));
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* --- App Container --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-sub {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item:hover {
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent-purple);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--accent-green);
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
    50% { opacity: 0.8; box-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
}

.content-body {
    padding: 24px 32px;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--accent-purple);
}

.card-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    cursor: default;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* --- Tables --- */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.03);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    padding: 48px 20px !important;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Badges --- */
.target-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.target-gmail { background: rgba(234, 67, 53, 0.15); color: #ea4335; }
.target-office365 { background: rgba(0, 120, 212, 0.15); color: #0078d4; }
.target-yahoo { background: rgba(67, 0, 153, 0.15); color: #430099; }
.target-aol { background: rgba(0, 153, 204, 0.15); color: #0099cc; }
.target-owa { background: rgba(0, 120, 212, 0.15); color: #0078d4; }
.target-serverdata { background: rgba(255, 165, 0, 0.15); color: #ffa500; }
.target-outlook { background: rgba(0, 120, 212, 0.15); color: #0078d4; }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-captured { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-claimed { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.status-expired { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-active { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-completed { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.status-cancelled { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-inactive { background: rgba(255, 165, 0, 0.15); color: #ffa500; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn i {
    font-size: 14px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(108, 43, 217, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-warning {
    background: rgba(234, 179, 8, 0.15);
    color: var(--accent-yellow);
}

.btn-warning:hover {
    background: rgba(234, 179, 8, 0.25);
}

.btn-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.btn-info:hover {
    background: rgba(59, 130, 246, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 10px 14px;
    padding-right: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    appearance: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 12px;
}

.filter-select {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

/* --- Quick Actions --- */
.quick-actions {
    display: flex;
    gap: 12px;
    padding: 12px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    font-family: inherit;
}

.action-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border-color: rgba(139, 92, 246, 0.3);
}

.action-btn i {
    font-size: 18px;
}

/* --- Settings Grid --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* --- Status Rows (Settings) --- */
.status-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.status-row:last-child {
    border-bottom: none;
}

.status-label {
    color: var(--text-muted);
    font-size: 13px;
}

.status-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.service-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.db-actions {
    display: flex;
    gap: 8px;
}

.help-text {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- URL Cell --- */
.url-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.url-cell code {
    font-size: 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Code Styling --- */
code {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
}

.token-cell, .password-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.email-cell {
    font-weight: 500;
}

.time-cell {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.cookie-count {
    font-weight: 700;
    color: var(--accent-purple);
}

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.3);
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.3);
}

/* --- Order Form --- */
.order-form {
    max-width: 600px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: flex;
    }
    .main-content {
        margin-left: 0;
    }
    .content-header {
        padding: 16px;
    }
    .content-body {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .quick-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-value {
        font-size: 22px;
    }
}

/* ============================================================
   FORM SELECT / BRAND DROPDOWN — Dark Theme Fix
   Overrides browser-default white background on <select>
   ============================================================ */

/* Brand dropdown — dark theme fix */
select.brand-select,
select.brand-select option {
    background-color: #1a1f2e !important;
    color: #e5e7eb !important;
    border-color: #2a2f4a !important;
}

select.brand-select:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}

/* Fix the select dropdown arrow */
select.brand-select {
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238b5cf6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px 12px !important;
    padding-right: 40px !important;
}

/* Ensure ALL select elements in the panel are dark */
select.form-control,
select {
    background-color: #1a1f2e !important;
    color: #e5e7eb !important;
    border: 1px solid #2a2f4a !important;
}

/* Dropdown option hover / selected state */
select.brand-select option:hover,
select.brand-select option:checked {
    background: #2a2f4a !important;
    color: #8b5cf6 !important;
}

/* === DARK DROPDOWN FIX === */
select.form-control, select {
    background-color: #1a1f2e !important;
    color: #e5e7eb !important;
    border: 1px solid #2a2f4a !important;
}
select.form-control:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}
select.form-control option {
    background-color: #1a1f2e !important;
    color: #e5e7eb !important;
}
input.form-control, textarea.form-control {
    background-color: #1a1f2e !important;
    color: #e5e7eb !important;
    border: 1px solid #2a2f4a !important;
}
input.form-control:focus, textarea.form-control:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}
.url-cell { display: flex; align-items: center; gap: 8px; }
.phish-link { color: #8b5cf6; text-decoration: none; font-size: 0.85rem; word-break: break-all; }
.phish-link:hover { color: #a78bfa; text-decoration: underline; }
.btn-copy { background: none; border: 1px solid #2a2f4a; color: #8b5cf6; cursor: pointer; border-radius: 4px; padding: 2px 8px; }
.btn-copy:hover { background: #2a2f4a; }
.brand-badge { background: #2a2f4a; color: #8b5cf6; padding: 4px 12px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }