/* ==========================================================================
   AETHERMAIL PREMIUM STYLING SYSTEM
   Harmonious Dark Theme, Cyberpunk Glassmorphism, Advanced Visual Aesthetics
   ========================================================================== */

:root {
    --bg-main: #0a070f;
    --bg-panel: #110e1a;
    --bg-card: rgba(23, 19, 36, 0.55);
    --bg-card-hover: rgba(35, 29, 54, 0.7);
    --border-color: rgba(147, 51, 234, 0.15);
    --border-color-glow: rgba(147, 51, 234, 0.35);
    
    /* Neon Palettes */
    --color-primary: #a855f7;      /* Neon Violet */
    --color-primary-glow: rgba(168, 85, 247, 0.45);
    --color-secondary: #06b6d4;    /* Neon Cyan */
    --color-secondary-glow: rgba(6, 182, 212, 0.45);
    
    /* Status Colors */
    --color-success: #10b981;      /* Emerald Green */
    --color-success-glow: rgba(16, 185, 129, 0.4);
    --color-warning: #f59e0b;      /* Warm Gold */
    --color-warning-glow: rgba(245, 158, 11, 0.4);
    --color-danger: #ef4444;       /* Glowing Red */
    --color-danger-glow: rgba(239, 68, 68, 0.4);
    --color-idle: #6b7280;         /* Slate Grey */
    
    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Fonts */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', Courier, monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Background glowing orbs for abstract space */
body::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: 10%;
    right: 15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar customizations */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 7, 15, 0.4);
}
::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.25);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.45);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* Header bar styling */
.app-header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    height: 64px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.brand-icon {
    width: 24px;
    height: 24px;
    color: var(--color-secondary);
    filter: drop-shadow(0 0 6px var(--color-secondary-glow));
}

.brand h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.brand h1 span {
    color: var(--color-primary);
    text-shadow: 0 0 10px var(--color-primary-glow);
}

.brand h1 .badge {
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.engine-state {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.indicator-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.indicator-circle.idle {
    background-color: var(--color-idle);
}

.indicator-circle.running {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
    animation: pulse 1.5s infinite alternate;
}

.thread-badge {
    background: var(--color-secondary);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    box-shadow: 0 0 6px var(--color-secondary-glow);
}

/* Core Panels Grid */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 64px);
}

.left-panel {
    width: 320px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    overflow: hidden; /* Prevent sidebar main scrollbar */
    flex-shrink: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-panel.collapsed {
    width: 0;
    padding: 0 0;
    margin-right: -1px;
    border-right: none;
    opacity: 0;
    pointer-events: none;
}

.left-panel-scroll {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto; /* Allow scrolling of the sidebar elements */
    flex: 1;
    padding-right: 4px; /* offset scrollbar overlap */
}

/* Right content panel */
.content-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    overflow: hidden;
    background: rgba(10, 7, 15, 0.2);
}

/* Shared Sections Containers */
.panel-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-section:hover {
    border-color: var(--border-color-glow);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.section-container {
    background: rgba(17, 14, 26, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.section-container:hover {
    border-color: var(--border-color-glow);
}

.section-header {
    background: rgba(25, 20, 36, 0.4);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-badge {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--color-primary);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 700;
}

/* ==========================================================================
   STATS DASHBOARD CARD
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: rgba(15, 12, 22, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-card:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.stat-card.total { border-color: rgba(168, 85, 247, 0.2); }
.stat-card.success { border-color: rgba(16, 185, 129, 0.2); }
.stat-card.expired { border-color: rgba(245, 158, 11, 0.2); }
.stat-card.error { border-color: rgba(239, 68, 68, 0.2); }

.stat-card.total:hover { border-color: var(--color-primary); box-shadow: 0 0 15px rgba(168, 85, 247, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1); }
.stat-card.success:hover { border-color: var(--color-success); box-shadow: 0 0 15px rgba(16, 185, 129, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1); }
.stat-card.expired:hover { border-color: var(--color-warning); box-shadow: 0 0 15px rgba(245, 158, 11, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1); }
.stat-card.error:hover { border-color: var(--color-danger); box-shadow: 0 0 15px rgba(239, 68, 68, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1); }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    opacity: 0.8;
}

.stat-card.total::before { background: linear-gradient(90deg, var(--color-primary), #c084fc); }
.stat-card.success::before { background: linear-gradient(90deg, var(--color-success), #34d399); }
.stat-card.expired::before { background: linear-gradient(90deg, var(--color-warning), #fbbf24); }
.stat-card.error::before { background: linear-gradient(90deg, var(--color-danger), #f87171); }

.stat-value {
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-mono);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.stat-card.total .stat-value { color: var(--color-primary); text-shadow: 0 0 8px var(--color-primary-glow); }
.stat-card.success .stat-value { color: var(--color-success); text-shadow: 0 0 8px var(--color-success-glow); }
.stat-card.expired .stat-value { color: var(--color-warning); text-shadow: 0 0 8px var(--color-warning-glow); }
.stat-card.error .stat-value { color: var(--color-danger); text-shadow: 0 0 8px var(--color-danger-glow); }

.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.8px;
}

/* ==========================================================================
   CONTROL PANEL FORM
   ========================================================================== */

.controller-grid-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 12px;
}

@media (max-width: 1024px) {
    .controller-grid-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .controller-grid-layout {
        grid-template-columns: 1fr;
    }
}

.action-buttons-horizontal {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.config-header-row {
    transition: all 0.2s ease;
}
.config-header-row:hover h2 {
    color: var(--color-secondary) !important;
}
.config-header-row:hover #config-toggle-status {
    color: #fff !important;
}
.config-header-row:hover svg {
    filter: drop-shadow(0 0 4px var(--color-secondary-glow));
    transform: scale(1.05);
}
.config-header-row svg {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.controller-card h2 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
    text-transform: uppercase;
}

/* 100% Brand-New Change Password Security panel */
.btn-toggle-visibility {
    color: var(--text-muted);
    transition: color 0.2s ease;
}
.btn-toggle-visibility:hover {
    color: var(--color-secondary) !important;
}

#pw-strength-bar {
    border-radius: 2px;
    box-shadow: 0 0 4px var(--color-danger-glow);
}

.pwd-checkpoint {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
}

.pwd-checkpoint.valid {
    color: var(--color-success) !important;
}

.pwd-checkpoint.valid .chk-icon {
    color: var(--color-success) !important;
}

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

.pwd-checkpoint.invalid .chk-icon {
    color: var(--color-danger) !important;
}

/* Loading button spinner */
#btn-submit-change-pw:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group label span {
    color: var(--color-secondary);
    font-weight: 700;
    font-family: var(--font-mono);
}

/* Custom slider input */
input[type="range"] {
    width: 100%;
    accent-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.05);
    height: 6px;
    border-radius: 4px;
    outline: none;
}

/* Text / Number / Select inputs styling */
input[type="number"],
input[type="text"],
input[type="password"],
select {
    width: 100%;
    background-color: rgba(10, 7, 15, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 12px;
    outline: none;
    transition: all 0.2s ease;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 6px var(--color-primary-glow);
}

/* Search Wrapper with Icon */
.search-wrapper {
    position: relative;
}

.search-wrapper input {
    padding-right: 32px;
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Button stylings */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.btn {
    width: 100%;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn svg {
    width: 12px;
    height: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #7c3aed);
    color: #fff;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 16px var(--color-primary-glow);
    transform: translateY(-1px);
}

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

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 0 16px var(--color-danger-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   REAL-TIME LOGGER / CONSOLE
   ========================================================================== */

.console-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    overflow: hidden;
    padding: 12px;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.console-header h2 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.console-header button {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-sans);
}

.console-header button:hover {
    text-decoration: underline;
}

.console-body {
    flex: 1;
    background-color: #050308;
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    overflow-y: auto;
    line-height: 1.5;
}

.log-line {
    margin-bottom: 4px;
    word-break: break-all;
}

.log-line .time {
    color: var(--text-muted);
    margin-right: 6px;
}

.log-line .email-tag {
    color: var(--color-secondary);
    margin-right: 4px;
}

.log-line.info { color: var(--text-primary); }
.log-line.success { color: var(--color-success); }
.log-line.warning { color: var(--color-warning); }
.log-line.error { color: var(--color-danger); }
.log-line.system { color: var(--color-primary); font-weight: bold; }

/* ==========================================================================
   ACCOUNTS TABLE
   ========================================================================== */

.account-section {
    flex: 1.1; /* slightly larger space for account list */
}

.search-accounts-wrapper input {
    background-color: rgba(10, 7, 15, 0.4);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
    outline: none;
    width: 200px;
}

.table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto; /* Allow horizontal scroll instead of squishing */
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.email-address-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 25px);
    display: inline-block;
    vertical-align: middle;
}

th {
    background-color: var(--bg-panel); /* Opaque background to hide scrolled data rows! */
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 12px 14px;
    text-align: left;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap; /* Keep columns wide */
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    white-space: nowrap; /* Keep columns wide */
}

tbody tr {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-left: 2px solid transparent;
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-left-color: rgba(168, 85, 247, 0.35);
}

tbody tr.selected-row {
    background-color: rgba(168, 85, 247, 0.12);
    border-left: 2px solid var(--color-primary);
    box-shadow: inset 4px 0 12px rgba(168, 85, 247, 0.08);
}

/* Password eye/copy styling */
.password-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-hidden {
    font-family: var(--font-mono);
    letter-spacing: 2px;
    color: var(--text-muted);
}

.password-btn {
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    font-size: 10px;
}

.password-btn:hover {
    text-decoration: underline;
}

/* Status Badge styling */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    width: fit-content;
}

.status-badge.idle { background: rgba(107, 114, 128, 0.15); border: 1px solid rgba(107, 114, 128, 0.3); color: var(--text-secondary); }
.status-badge.running { background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.3); color: var(--color-secondary); }
.status-badge.success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--color-success); }
.status-badge.expired { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--color-warning); }
.status-badge.error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--color-danger); }

/* Copy action button in grid */
.btn-table-action {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.btn-table-action:hover {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 8px var(--color-primary-glow);
}

.table-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

/* Spinner loader */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(168, 85, 247, 0.2);
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

/* ==========================================================================
   EMAIL PANEL / OTP VIEW
   ========================================================================== */

.email-section {
    flex: 1; /* half vertical space */
}

.selected-mail-header {
    font-size: 12px;
    color: var(--color-secondary);
    font-weight: 500;
}

.email-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.emails-grid-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.emails-header-grid {
    display: grid;
    grid-template-columns: 200px 1fr 140px 160px;
    background-color: rgba(25, 20, 36, 0.15);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.emails-list-body {
    flex: 1;
    overflow-y: auto;
}

/* Row of email */
.email-item-row {
    display: grid;
    grid-template-columns: 200px 1fr 140px 160px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s ease;
}

.email-item-row:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.email-sender-col {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.email-content-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    padding-right: 16px;
}

.email-subject {
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-snippet {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* OTP Code badge wrapper */
.email-otp-col {
    display: flex;
    justify-content: center;
    align-items: center;
}

.otp-pill {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(16, 185, 129, 0.15));
    border: 1px solid var(--color-secondary);
    color: var(--color-secondary);
    text-shadow: 0 0 4px var(--color-secondary-glow);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: copy;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.otp-pill:hover {
    transform: scale(1.05);
    background: var(--color-secondary);
    color: #000;
    text-shadow: none;
    box-shadow: 0 0 8px var(--color-secondary-glow);
}

.email-date-col {
    color: var(--text-secondary);
    font-size: 11px;
    text-align: right;
}

.empty-emails {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    padding: 40px;
    text-align: center;
    gap: 12px;
}

.empty-emails svg {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-emails p {
    font-size: 12px;
    max-width: 400px;
    line-height: 1.5;
}

/* ==========================================================================
   MODAL EMAIL DIALOG
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 3, 8, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 1000px;
    max-width: 90%;
    height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    background-color: rgba(25, 20, 36, 0.3);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
}

.modal-sender-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-sender-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-sender-meta .divider {
    color: var(--text-muted);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.close-modal-btn:hover {
    color: var(--color-danger);
}

.modal-body-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Banner shown when email contains OTP */
.modal-otp-banner {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(168, 85, 247, 0.1));
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
}

.modal-otp-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.modal-otp-code {
    font-family: var(--font-mono);
    font-size: 20px;
    color: var(--color-secondary);
    text-shadow: 0 0 10px var(--color-secondary-glow);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-secondary);
    border-radius: 6px;
    padding: 2px 14px;
    letter-spacing: 2px;
}

.btn-copy-otp {
    background: var(--color-secondary);
    border: none;
    border-radius: 4px;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 6px 14px;
    cursor: pointer;
    box-shadow: 0 0 8px var(--color-secondary-glow);
    transition: all 0.2s ease;
}

.btn-copy-otp:hover {
    background: #fff;
    box-shadow: 0 0 12px #fff;
}

/* iFrame container to render mail content */
.email-body-wrapper {
    flex: 1;
    background-color: #fff; /* White background to match standard email formatting */
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

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

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

@keyframes pulse {
    from { box-shadow: 0 0 4px var(--color-success-glow); opacity: 0.8; }
    to { box-shadow: 0 0 12px var(--color-success); opacity: 1; }
}

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

/* ==========================================================================
   TABS AND NAVIGATION SYSTEM
   ========================================================================== */

.tab-bar {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(17, 13, 26, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(168, 85, 247, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
    margin-bottom: 4px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 22px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.16), rgba(6, 182, 212, 0.06));
    border-color: rgba(168, 85, 247, 0.45);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    position: relative;
}

.tab-btn.active .tab-icon {
    color: var(--color-secondary);
    filter: drop-shadow(0 0 4px var(--color-secondary-glow));
    transform: scale(1.12);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    box-shadow: 0 0 8px var(--color-secondary);
    border-radius: 2px;
}

.tab-icon {
    width: 15px;
    height: 15px;
    transition: transform 0.25s ease, color 0.25s ease;
}

/* Hide tab contents by default */
.tab-content {
    display: none !important;
}

/* Show active tab content */
.tab-content.active-content {
    display: flex !important;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

/* Adjust sections inside tabs to be full size */
.tab-content.section-container {
    height: 100%;
}

.account-section, .otp-hub-section, .email-section {
    flex: 1 !important;
    height: 100% !important;
}

/* Styling specifically for OTP Hub Table */
#otp-hub-table td {
    padding: 12px 14px;
}

.otp-hub-email-cell {
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--color-primary);
    font-size: 11px;
}

/* ==========================================================================
   ACCOUNTS EDITOR & SIDEBAR LAYOUT
   ========================================================================== */

.tab-accounts-layout {
    display: flex;
    gap: 16px;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.accounts-table-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.btn-sidebar-toggle {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--color-secondary);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-sidebar-toggle:hover {
    background: var(--color-secondary);
    color: #000;
    box-shadow: 0 0 10px var(--color-secondary-glow);
}

.btn-sidebar-toggle.collapsed-btn {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--color-primary);
}

.btn-sidebar-toggle.collapsed-btn:hover {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 10px var(--color-primary-glow);
}

.btn-editor-toggle {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--color-primary);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-editor-toggle:hover {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 10px var(--color-primary-glow);
}

/* Editor Sidebar container */
.accounts-editor-sidebar {
    width: 330px;
    background: rgba(18, 14, 30, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    animation: sidebarSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.editor-header {
    background: rgba(25, 20, 36, 0.4);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header h3 {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.close-editor-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.close-editor-btn:hover {
    color: var(--color-danger);
}

.editor-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Sub tabs inside editor */
.editor-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.editor-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 700;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.editor-tab-btn:hover {
    color: var(--text-primary);
}

.editor-tab-btn.active {
    background: var(--bg-panel);
    color: var(--color-secondary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.editor-tab-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Textarea input */
textarea {
    width: 100%;
    background-color: rgba(10, 7, 15, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 10px;
    outline: none;
    resize: none;
    transition: all 0.2s ease;
    line-height: 1.5;
}

textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 6px var(--color-primary-glow);
}

/* Single CRUD form styles */
#editor-tab-single h4 {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 4px;
}

.single-editor-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

/* Danger table actions styling */
.btn-table-action.edit {
    background: rgba(6, 182, 212, 0.05);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--color-secondary);
}

.btn-table-action.edit:hover {
    background: var(--color-secondary);
    color: #000;
    box-shadow: 0 0 8px var(--color-secondary-glow);
}

.btn-table-action.delete {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
}

.btn-table-action.delete:hover {
    background: var(--color-danger);
    color: #fff;
    box-shadow: 0 0 8px var(--color-danger-glow);
}

/* Copy email and eye/mailbox action icons styling */
.btn-copy-email {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-copy-email:hover {
    color: var(--color-secondary);
    background-color: rgba(255, 255, 255, 0.08);
}

.btn-table-action.view-mailbox {
    background: rgba(168, 85, 247, 0.05);
    border-color: rgba(168, 85, 247, 0.2);
    color: var(--color-primary);
    font-size: 11px;
}

.btn-table-action.view-mailbox:hover {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 8px var(--color-primary-glow);
}

/* Tab Export Styles */
#editor-tab-export h4 {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 4px;
}

/* ==========================================================================
   NEXT-GEN CYBERPUNK EXTENSIONS & LAYOUT FIXES
   ========================================================================== */

/* Animated Scanning Grid Background */
.app-container {
    position: relative;
    z-index: 1;
}

.app-container::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        linear-gradient(rgba(168, 85, 247, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    pointer-events: none;
    opacity: 0.8;
    animation: gridScan 25s linear infinite;
}

@keyframes gridScan {
    from { background-position: 0 0; }
    to { background-position: 50px 50px; }
}

/* Stat card glowing lasers at bottom */
.stat-card {
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(255, 255, 255, 0.02) !important;
}

.stat-card::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--stat-glow-color, var(--color-primary)), transparent);
    box-shadow: 0 0 10px var(--stat-glow-color, var(--color-primary));
}

.stat-card.total { --stat-glow-color: var(--color-primary); }
.stat-card.success { --stat-glow-color: var(--color-success); }
.stat-card.expired { --stat-glow-color: var(--color-warning); }
.stat-card.error { --stat-glow-color: var(--color-danger); }

/* Quick Status Filter Chips styles */
.filter-chip {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.filter-chip.active {
    background: rgba(168, 85, 247, 0.12);
    border-color: var(--color-primary);
    color: var(--text-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
    text-shadow: 0 0 4px var(--color-primary-glow);
}

/* Bulk operation and checkbox spacing */
.checkbox-cell {
    text-align: center;
    vertical-align: middle;
}

/* Custom Checkboxes */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    background: rgba(10, 7, 15, 0.6);
    cursor: pointer;
    position: relative;
    display: inline-block;
    vertical-align: middle;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"]:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 6px var(--color-primary-glow);
}

input[type="checkbox"]:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary-glow);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 1.5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Dynamic Active Glowing Filter Chips */
.filter-chip[data-filter="all"].active {
    background: rgba(168, 85, 247, 0.12) !important;
    border-color: var(--color-primary) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 10px var(--color-primary-glow) !important;
    text-shadow: 0 0 4px var(--color-primary-glow) !important;
}

.filter-chip[data-filter="success"].active {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: var(--color-success) !important;
    color: var(--color-success) !important;
    box-shadow: 0 0 10px var(--color-success-glow) !important;
    text-shadow: 0 0 4px var(--color-success-glow) !important;
}

.filter-chip[data-filter="expired"].active {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: var(--color-warning) !important;
    color: var(--color-warning) !important;
    box-shadow: 0 0 10px var(--color-warning-glow) !important;
    text-shadow: 0 0 4px var(--color-warning-glow) !important;
}

.filter-chip[data-filter="error"].active {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: var(--color-danger) !important;
    color: var(--color-danger) !important;
    box-shadow: 0 0 10px var(--color-danger-glow) !important;
    text-shadow: 0 0 4px var(--color-danger-glow) !important;
}

.filter-chip[data-filter="has-otp"].active {
    background: rgba(6, 182, 212, 0.12) !important;
    border-color: var(--color-secondary) !important;
    color: var(--color-secondary) !important;
    box-shadow: 0 0 10px var(--color-secondary-glow) !important;
    text-shadow: 0 0 4px var(--color-secondary-glow) !important;
}

/* Sleek Action Buttons Redesign */
.btn-table-action {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 6px !important;
    color: var(--text-secondary) !important;
    cursor: pointer;
    padding: 6px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
    width: 28px !important;
    height: 28px !important;
    vertical-align: middle;
}

.btn-table-action svg.action-icon {
    width: 14px !important;
    height: 14px !important;
    transition: transform 0.2s ease;
}

.btn-table-action:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.btn-table-action:hover svg.action-icon {
    transform: scale(1.1);
}

/* Specific Glowing Hovers for Action Types */
.btn-table-action.preview:hover {
    color: var(--color-secondary) !important;
    background: rgba(6, 182, 212, 0.1) !important;
    border-color: var(--color-secondary) !important;
    box-shadow: 0 0 10px var(--color-secondary-glow) !important;
}

.btn-table-action.check:hover {
    color: var(--color-primary) !important;
    background: rgba(168, 85, 247, 0.1) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 10px var(--color-primary-glow) !important;
}

.btn-table-action.edit:hover {
    color: var(--color-success) !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: var(--color-success) !important;
    box-shadow: 0 0 10px var(--color-success-glow) !important;
}

.btn-table-action.delete:hover {
    color: var(--color-danger) !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 10px var(--color-danger-glow) !important;
}

/* Disabled action buttons state */
.btn-table-action:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    background: rgba(255, 255, 255, 0.01) !important;
    border-color: rgba(255, 255, 255, 0.03) !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
}

/* Sleek Password Micro Rounded Pill Button */
.password-btn {
    background: rgba(6, 182, 212, 0.05) !important;
    border: 1px solid rgba(6, 182, 212, 0.2) !important;
    border-radius: 10px !important;
    color: var(--color-secondary) !important;
    cursor: pointer;
    font-size: 9px !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.password-btn:hover {
    background: var(--color-secondary) !important;
    color: #000 !important;
    box-shadow: 0 0 8px var(--color-secondary-glow) !important;
    text-decoration: none !important;
}



