/* ==========================================================================
   CSS variables & Theme Definitions
   ========================================================================== */
:root {
    /* Fonts */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transition speeds */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Theme colors - DARK MODE (Cyber Obsidian & Indigo-Cyan) */
    --bg-base: #030712;
    --bg-card: #0b0f19;
    --primary: #6366f1; /* Vibrant Indigo-Purple */
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.2);
    --secondary: rgba(255, 255, 255, 0.04);
    --secondary-hover: rgba(255, 255, 255, 0.08);
    --accent: #06b6d4; /* Cyber Cyan */
    --accent-glow: rgba(6, 182, 212, 0.2);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #030712;
    --border-glass: rgba(99, 102, 241, 0.16);
    --bg-glass: rgba(11, 15, 25, 0.75);
    --shadow-glass: 0 12px 40px 0 rgba(0, 0, 0, 0.5), 0 2px 8px 0 rgba(99, 102, 241, 0.05);
    
    /* Status colors */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
}

body.light-theme {
    /* Theme colors - LIGHT MODE (Snowy White & Indigo) */
    --bg-base: #f8fafc;
    --bg-card: #ffffff;
    --primary: #4f46e5; /* Premium Indigo */
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --secondary: rgba(79, 70, 229, 0.04);
    --secondary-hover: rgba(79, 70, 229, 0.08);
    --accent: #0ea5e9; /* Sky Blue */
    --accent-glow: rgba(14, 165, 233, 0.15);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    --border-glass: rgba(79, 70, 229, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.8);
    --shadow-glass: 0 12px 40px 0 rgba(79, 70, 229, 0.04), 0 2px 8px 0 rgba(79, 70, 229, 0.02);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.03) 0px, transparent 50%),
        radial-gradient(at 50% 0%, rgba(14, 165, 233, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.03) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition-normal) ease;
}

/* Glow Background Spheres */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(160px);
    z-index: -1;
    opacity: 0.25;
    pointer-events: none;
    transition: all var(--transition-slow) ease;
    animation: floatGlow 25s infinite alternate ease-in-out;
}

body.light-theme .bg-glow {
    opacity: 0.15;
}

.bg-glow-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -150px;
    right: -100px;
}

.bg-glow-2 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.bg-glow-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    top: 35%;
    left: 45%;
    animation-delay: -12s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(80px, 40px) scale(1.15);
    }
    100% {
        transform: translate(-50px, -60px) scale(0.9);
    }
}

/* Glassmorphism Class */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100vh;
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 1.25rem;
    animation: fadeInDown var(--transition-slow) ease;
    position: relative;
    z-index: 500;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon-wrapper {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.logo-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-rent {
    padding: 0.45rem 1.15rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--secondary);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    transition: all var(--transition-fast);
}

.btn-rent:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

.btn-admin {
    padding: 0.45rem 1.15rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--primary-glow);
    border: 1px solid var(--primary);
    color: var(--primary);
    transition: all var(--transition-fast);
}

.btn-admin:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
}

.btn-head-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.status-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--color-success);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGlow 2s infinite;
}

.btn-icon {
    background: var(--secondary);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

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

.server-selector-container {
    position: relative;
}

.server-select {
    padding: 0.35rem 2rem 0.35rem 0.75rem !important;
    font-size: 0.8rem !important;
    border-radius: 2rem !important;
    background-color: var(--secondary) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-glass) !important;
    cursor: pointer;
    outline: none;
    font-weight: 600;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
    width: auto !important;
}

.server-select:hover {
    background-color: var(--secondary-hover) !important;
    border-color: var(--primary) !important;
    transform: translateY(-1px);
}

.server-selector-container::after {
    content: "" !important;
    border-style: solid !important;
    border-width: 4px 4px 0 4px !important;
    border-color: var(--text-muted) transparent transparent transparent !important;
    position: absolute !important;
    right: 0.85rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}

.alert-info-box {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-main);
}

.alert-info-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.alert-info-title .alert-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.alert-info-body {
    padding-left: 1.6rem;
    color: var(--text-muted);
}

.code-ip {
    background: rgba(0, 0, 0, 0.15);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
    color: var(--primary);
}

body.dark-theme .code-ip {
    background: rgba(255, 255, 255, 0.1);
}

/* Light/Dark Toggle Icon Visibility */
body.dark-theme .sun-icon { display: block; }
body.dark-theme .moon-icon { display: none; }
body.light-theme .sun-icon { display: none; }
body.light-theme .moon-icon { display: block; }

/* ==========================================================================
   Generator Component
   ========================================================================== */
.generator-section {
    padding: 1.5rem 2rem;
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeInUp var(--transition-slow) ease;
}

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

.label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.expiry-timer {
    font-size: 0.85rem;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    color: var(--accent);
    font-weight: 600;
}

.email-input-wrapper {
    display: flex;
    gap: 0.5rem;
    background: rgba(11, 15, 25, 0.5);
    border: 1px solid var(--border-glass);
    padding: 0.5rem;
    border-radius: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

body.light-theme .email-input-wrapper {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(79, 70, 229, 0.15);
}

.email-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}

body.light-theme .email-input-wrapper:focus-within {
    box-shadow: 0 0 16px rgba(79, 70, 229, 0.15);
}

.email-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    padding: 0.5rem 0.75rem;
    width: 100%;
}

.btn-copy-address {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: var(--text-inverse);
    border: none;
    outline: none;
    padding: 0.65rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px var(--primary-glow);
    color: white;
}

.btn-copy-address:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
}

.btn-copy-address:active {
    transform: scale(0.98);
}

/* Generator Buttons Actions Row */
.generator-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1.25rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn i {
    width: 1.15rem;
    height: 1.15rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: var(--secondary);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

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

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

/* Spinner Rotate Animation for Refresh */
.btn-icon-spin.spinning {
    animation: spin 1s linear infinite;
}

/* Auto Refresh styling */
.auto-refresh-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 0.1s linear;
}

.auto-refresh-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* ==========================================================================
   Mail Split Section
   ========================================================================= */
.mail-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: 450px;
    animation: fadeInUp var(--transition-slow) ease;
    animation-delay: 0.1s;
    transition: grid-template-columns 0.3s ease;
}

.mail-section.reader-active {
    grid-template-columns: 380px 1fr;
}

/* On desktop, hide reader pane when not active */
@media (min-width: 769px) {
    .mail-section:not(.reader-active) .reader-pane {
        display: none;
    }
}

/* Inbox Pane styling */
.inbox-pane {
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 580px;
}

.pane-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pane-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.inbox-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
}

/* Scrollbar styles for glass container */
.inbox-list::-webkit-scrollbar,
.email-body-wrapper::-webkit-scrollbar {
    width: 6px;
}
.inbox-list::-webkit-scrollbar-track,
.email-body-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.inbox-list::-webkit-scrollbar-thumb,
.email-body-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}
.inbox-list::-webkit-scrollbar-thumb:hover,
.email-body-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* List Status Indicators */
.inbox-status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.empty-icon-wrapper {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid var(--border-glass);
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary);
    animation: floatIcon 3s ease-in-out infinite;
}

.empty-icon {
    width: 2rem;
    height: 2rem;
}

.inbox-status-container h3 {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.inbox-status-container p {
    font-size: 0.8rem;
    max-width: 250px;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.waiting-indicator {
    font-size: 0.75rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Typing Dots Animation */
.dot-typing::after {
    content: '.';
    animation: typing 1.5s steps(4, end) infinite;
}

/* List items styling */
.email-items-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.email-item {
    padding: 1.15rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border-glass);
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--secondary);
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.email-item-layout {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    width: 100%;
}

.item-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.email-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.email-subject-wrapper {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.email-item:hover {
    background: var(--secondary-hover);
    border-color: var(--border-glass);
    transform: translateX(4px);
}

.email-item.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    border-left-color: var(--primary);
}

body.light-theme .email-item {
    background: rgba(99, 102, 241, 0.02);
    border-color: rgba(99, 102, 241, 0.06);
}

body.light-theme .email-item:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.12);
}

body.light-theme .email-item.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
    border-left-color: var(--primary);
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.sender-unread-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    flex: 1;
}

.unread-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--primary-glow);
}

.email-item.unread .email-sender {
    font-weight: 700;
    color: var(--text-main);
}

.email-item.unread .email-subject {
    font-weight: 700;
}

.email-sender {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.email-subject {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-excerpt {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
}

/* ==========================================================================
   Reader Pane Component
   ========================================================================== */
.reader-pane {
    border-radius: 1.5rem;
    overflow: hidden;
    height: 580px;
    display: flex;
    flex-direction: column;
}

.reader-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-icon-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--text-muted);
}

.placeholder-icon {
    width: 2.25rem;
    height: 2.25rem;
}

.reader-placeholder h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.reader-placeholder p {
    font-size: 0.85rem;
    max-width: 320px;
    line-height: 1.4;
}

/* Email Viewer Pane Active State */
.email-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeIn var(--transition-normal) ease;
}

.email-viewer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.viewer-actions-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.view-subject {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.email-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.meta-row {
    display: flex;
    gap: 0.5rem;
}

.meta-label {
    color: var(--text-muted);
    min-width: 60px;
}

.meta-value {
    color: var(--text-main);
}

.font-semibold {
    font-weight: 600;
}

.sender-info-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.sender-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.sender-avatar:hover {
    transform: scale(1.05);
}

/* Email Body Container with safe sandboxed Iframe */
.email-body-wrapper {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .email-body-wrapper {
    background: rgba(255, 255, 255, 0.4);
}

#email-body-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
.app-footer {
    text-align: center;
    padding: 1rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-glass);
    margin-top: auto;
}

/* ==========================================================================
   Modal Dialog styling
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    transition: opacity var(--transition-fast) ease;
}

.modal-content {
    width: 95%;
    max-width: 450px;
    border-radius: 1.5rem;
    overflow: hidden;
    transform: scale(1);
    transition: transform var(--transition-fast) ease;
    animation: modalPop var(--transition-fast) cubic-bezier(0.34, 1.56, 0.64, 1) both;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

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

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}

.modal-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.form-input {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    width: 100%;
    transition: border-color var(--transition-fast);
}

body.light-theme .form-input {
    background: rgba(255, 255, 255, 0.8);
}

.form-input:focus {
    border-color: var(--primary);
}

.select-wrapper {
    position: relative;
}

.form-select {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--transition-fast);
}

body.light-theme .form-select {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
}

/* Custom dropdown arrow for select */
.select-wrapper::after {
    content: "";
    border-style: solid;
    border-width: 5px 5px 0 5px;
    border-color: var(--text-muted) transparent transparent transparent;
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.form-select:focus {
    border-color: var(--primary);
}

/* Styles for dropdown options on dark and light modes */
.form-select option {
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 10px;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==========================================================================
   Toast Notifications System
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
    max-width: 320px;
}

.toast {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 1rem 1.25rem;
    border-radius: 0.85rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid var(--primary);
    transform: translateY(100px);
    opacity: 0;
    animation: toastShow 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast-success {
    border-left-color: var(--color-success);
}

.toast-info {
    border-left-color: var(--accent);
}

.toast-error {
    border-left-color: var(--color-error);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-info .toast-icon { color: var(--accent); }
.toast-error .toast-icon { color: var(--color-error); }

.toast-message {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ==========================================================================
   Helper classes
   ========================================================================== */
.hidden {
    display: none !important;
}

.mobile-only {
    display: none;
}

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes typing {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

@keyframes floatIcon {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

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

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastShow {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
    .mail-section {
        grid-template-columns: 320px 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 0.5rem 0.5rem 5.5rem 0.5rem !important; /* Extra bottom padding for floating mobile-nav */
        height: 100vh;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        overflow: hidden; /* Lock viewport */
    }
    
    .app-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.65rem 0.75rem !important;
        border-radius: 1rem !important;
        flex-shrink: 0;
        gap: 1rem;
    }
    
    .logo-area {
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

    .logo-icon-wrapper {
        width: 2rem;
        height: 2rem;
        border-radius: 0.5rem;
    }

    .logo-icon-wrapper i {
        width: 1rem;
        height: 1rem;
    }

    .logo-text h1 {
        font-size: 1.05rem;
    }

    .logo-text p {
        display: none;
    }

    .app-footer {
        display: none !important; /* Hide footer on mobile to reclaim height for emails */
    }
    
    .generator-section {
        padding: 1rem;
        border-radius: 1rem;
        gap: 0.5rem;
        flex-shrink: 0; /* Lock height */
    }
    
    .email-display-card {
        padding: 0.35rem 0.5rem;
        border-radius: 0.75rem;
    }

    .email-address-wrapper {
        font-size: 1.05rem !important;
        padding: 0.25rem 0.35rem;
    }

    .btn-copy-address {
        padding: 0.35rem 0.75rem !important;
        font-size: 0.75rem !important;
        border-radius: 0.4rem !important;
    }
    
    /* Flex grid actions layout to prevent alignment holes */
    .generator-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .generator-actions .btn {
        flex: 1 1 calc(50% - 0.25rem) !important;
        min-width: 0 !important;
        padding: 0.5rem 0.65rem !important;
        font-size: 0.75rem !important;
        border-radius: 0.6rem !important;
        width: auto !important;
    }
    
    #btn-new-email {
        flex: 1 1 100% !important;
    }

    .mail-section {
        flex-grow: 1; /* Automatically fill remaining viewport space */
        height: auto !important;
        min-height: 0 !important;
        grid-template-columns: 1fr;
        position: relative;
        overflow: hidden;
        border-radius: 1rem;
    }

    /* Provide solid background for pane cards to prevent text overlap during transitions */
    .inbox-pane, .reader-pane {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--bg-card) !important;
        border-radius: 1.25rem !important;
        border: 1px solid var(--border-glass) !important;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
        will-change: transform, opacity;
    }

    /* On mobile, standard split screen shifts between showing List or Reader */
    .mail-section.reader-active .inbox-pane {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
    }

    .mail-section.reader-active .reader-pane {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .mail-section:not(.reader-active) .inbox-pane {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .mail-section:not(.reader-active) .reader-pane {
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
    }

    .mobile-only {
        display: flex;
    }

    .btn-back {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 5.75rem; /* Lift toasts above the bottom nav bar dock */
        max-width: none;
    }
}

/* ==========================================================================
   Custom Dropdown Component (Select Wrapper)
   ========================================================================== */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    z-index: 100;
}

#server-select-wrapper {
    width: 250px;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 1rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    border-radius: 2rem !important;
    border: 1px solid var(--border-glass) !important;
    background-color: var(--secondary) !important;
    color: var(--text-main) !important;
    cursor: pointer;
    transition: all var(--transition-fast) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom-select-trigger:hover {
    background-color: var(--secondary-hover) !important;
    border-color: var(--primary) !important;
    transform: translateY(-1px);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px var(--primary-glow) !important;
}

.custom-select-trigger .arrow-icon {
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast) ease;
}

.custom-select-wrapper.open .arrow-icon {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    border-radius: 1rem;
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast) cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-glass);
    z-index: 200;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.custom-option:hover {
    background: var(--secondary-hover);
    color: var(--text-main);
    padding-left: 1.25rem;
}

.custom-option.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

/* Style for custom dropdown scrollbar */
#custom-domain-options::-webkit-scrollbar {
    width: 6px;
}
#custom-domain-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.75rem;
}
#custom-domain-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
#custom-domain-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Ensure the dropdown doesn't get clipped by the modal container */
#username-modal .modal-content,
#username-modal .modal-body {
    overflow: visible !important;
}

/* ==========================================================================
   Login / Register Auth Overlay Screen
   ========================================================================== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 26, 0.45);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: all var(--transition-normal) ease;
}

body.light-theme .auth-overlay {
    background: rgba(240, 246, 252, 0.45);
}

.auth-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-card {
    width: 95%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    border-radius: 2rem;
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 70px rgba(10, 14, 26, 0.25);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: scale(0.96);
    opacity: 0;
    animation: authCardEntry 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.light-theme .auth-card {
    box-shadow: 0 30px 70px rgba(37, 99, 235, 0.08);
}

@keyframes authCardEntry {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.auth-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--primary);
}

.auth-logo i {
    width: 2.25rem;
    height: 2.25rem;
}

.auth-logo h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.85rem;
    padding: 0.25rem;
    border: 1px solid var(--border-glass);
}

body.light-theme .auth-tabs {
    background: rgba(37, 99, 235, 0.04);
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.65rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 0.65rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.auth-tab-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

body.light-theme .auth-tab-btn.active {
    background: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.08);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: formSwitch 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes formSwitch {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrapper .form-input {
    padding-left: 2.75rem !important;
    transition: all 0.2s ease;
}

.auth-input-wrapper .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    width: 1.15rem;
    height: 1.15rem;
    pointer-events: none;
    transition: color var(--transition-fast) ease;
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--primary);
}

.auth-submit-btn {
    margin-top: 0.5rem;
    width: 100%;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
}

.auth-submit-btn:active {
    transform: translateY(1px);
}

/* ==========================================================================
   Danger Modal / Confirmation Styles
   ========================================================================== */
.alert-danger-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-main);
}

body.light-theme .alert-danger-box {
    background: rgba(239, 68, 68, 0.03);
}

.danger-icon {
    width: 1.8rem;
    height: 1.8rem;
    color: var(--color-error);
    flex-shrink: 0;
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-error), #dc2626) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2) !important;
    border: none !important;
}

.btn-danger:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-2px) !important;
}

.btn-danger:active {
    transform: translateY(0) !important;
}

/* ==========================================================================
   Admin Console & Stats Dashboard Styles
   ========================================================================== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.admin-stat-card {
    padding: 1.25rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid var(--border-glass);
    transition: all var(--transition-fast) ease;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.light-theme .admin-stat-card:hover {
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.05);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
}

.stat-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--primary);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.admin-console-wrapper {
    background: #090c15;
    border: 1px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.console-header {
    background: #111827;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e293b;
}

.console-dots {
    display: flex;
    gap: 0.35rem;
}

.console-dots span {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.console-title {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: #64748b;
}

.console-body {
    padding: 1rem;
    height: 250px;
    overflow-y: auto;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    line-height: 1.5;
    color: #38bdf8;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.console-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.console-line.system {
    color: #10b981;
}

.console-line .timestamp {
    color: #64748b;
    margin-right: 0.5rem;
}

/* ==========================================================================
   Pricing Table / Sewa Website Styles
   ========================================================================== */
.rent-modal-content {
    background: var(--bg-main);
    border: 1px solid var(--border-glass);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}

.pricing-plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.75rem;
    align-items: stretch;
    margin-top: 1rem;
    padding: 0.5rem;
}

.pricing-card {
    position: relative;
    border-radius: 1.75rem;
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border: 1px solid var(--border-glass);
    background: var(--bg-card);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: all 0.3s ease;
}

/* Hover effects */
.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border-color: var(--primary-glow);
}

body.light-theme .pricing-card:hover {
    box-shadow: 0 20px 45px rgba(37, 99, 235, 0.08);
}

/* Plan Specific Styling */
.pricing-card:nth-child(1)::before {
    background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

/* Recommended/Standard Plan */
.recommended-plan {
    border: 2px solid var(--primary) !important;
    background: rgba(37, 99, 235, 0.05) !important;
    transform: scale(1.03);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.15);
}

.recommended-plan::before {
    background: linear-gradient(90deg, var(--primary), #4f46e5) !important;
}

.recommended-plan:hover {
    transform: scale(1.03) translateY(-8px);
    box-shadow: 0 25px 50px rgba(37, 99, 235, 0.25);
}

/* Premium Plan */
.pricing-card:nth-child(3)::before {
    background: linear-gradient(90deg, #d97706, #f59e0b);
}

.pricing-card:nth-child(3):hover {
    border-color: #f59e0b;
}

.plan-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.plan-badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--border-glass);
}

body.light-theme .plan-badge {
    background: rgba(0, 0, 0, 0.04);
}

.recommended-plan .plan-badge {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.plan-header h4 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    margin-top: 0.5rem;
}

.price-currency {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.recommended-plan .price-currency {
    color: #4f46e5;
}

.price-value {
    font-size: 2.75rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.03em;
    font-family: 'Outfit', sans-serif;
}

.price-period {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 0.15rem;
}

.plan-features {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    flex-grow: 1;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 1.25rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.825rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-main);
}

.feature-item i {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.feature-item i[data-lucide="check-circle-2"] {
    color: #10b981;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.2));
}

.feature-item i[data-lucide="x-circle"] {
    color: #ef4444;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.2));
}

.feature-item.disabled {
    color: var(--text-muted);
    opacity: 0.5;
    text-decoration: line-through;
}

/* Action button inside card */
.pricing-card .btn {
    margin-top: auto;
    font-weight: 700;
    padding: 0.85rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

.recommended-plan .btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    border: none;
    color: white;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.recommended-plan .btn-primary:hover {
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

/* Premium plan button */
.pricing-card:nth-child(3) .btn-secondary {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border: none;
    color: white;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.pricing-card:nth-child(3) .btn-secondary:hover {
    box-shadow: 0 12px 25px rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .pricing-plans-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .recommended-plan {
        transform: none;
    }
    
    .recommended-plan:hover {
        transform: translateY(-8px);
    }
}

/* Modal Content Width & Layout Adjustments */
.admin-modal-content {
    max-width: 800px !important;
    width: 90% !important;
}

.rent-modal-content {
    max-width: 900px !important;
    width: 95% !important;
    background: var(--bg-glass) !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-glass) !important;
}

.rent-subtitle {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-order-plan {
    width: 100% !important;
}

#wa-admin-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
}

#btn-refresh-admin {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Modal form inputs visual enhancements */
.form-input:focus,
.form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 12px var(--primary-glow) !important;
}

/* Settings Modal Specific Layout overrides */
#settings-modal #server-select-wrapper {
    width: 100% !important;
}

/* SPA Pages Layout */
.app-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    animation: pageFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
#page-inbox {
    overflow: hidden;
}
#page-rent,
#page-admin,
#page-dashboard {
    overflow-y: auto;
    padding-bottom: 2rem;
}

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

/* Sidebar Drawer Overlay Backdrop */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    transition: opacity 0.3s ease;
}
.drawer-backdrop.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Sidebar Slide-out Drawer */
.sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: #0f172a; /* Slate 900 background matching screenshot */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none; /* No shadow when closed to prevent faint black line on left screen edge */
}
.sidebar-drawer.open {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4); /* Faint shadow only when opened */
}

body.light-theme .sidebar-drawer {
    background: #1e293b; /* Keep it dark slate even in light theme, just like AM Creator */
}

/* Drawer Header */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.drawer-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.drawer-logo .logo-icon-wrapper {
    width: 2.25rem;
    height: 2.25rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-logo .logo-icon-wrapper i {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--primary);
}

.drawer-logo .logo-text h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.drawer-logo .logo-text p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.15rem;
}

.btn-close-drawer {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-close-drawer:hover {
    color: #fff;
}

.btn-close-drawer i {
    width: 1.25rem;
    height: 1.25rem;
}

/* Drawer Content */
.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.drawer-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.section-title {
    font-size: 0.725rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.3);
    padding-left: 0.75rem;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Drawer Nav Items */
.drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    text-decoration: none;
    transition: all var(--transition-fast) ease;
}

.drawer-nav-item i {
    width: 1.15rem;
    height: 1.15rem;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.2s ease;
}

.drawer-nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.drawer-nav-item:hover i {
    color: #fff;
}

/* Active Item White Pill styling matching screenshot */
.drawer-nav-item.active {
    background: #ffffff !important;
    color: #0f172a !important; /* Bold dark text */
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.drawer-nav-item.active i {
    color: #0f172a !important; /* Icons turn dark */
}

/* Specific Special Colored Items */
.drawer-nav-item.wa-link {
    color: #10b981 !important; /* WhatsApp green */
}
.drawer-nav-item.wa-link i {
    color: #10b981 !important;
}
.drawer-nav-item.wa-link:hover {
    background: rgba(16, 185, 129, 0.08) !important;
}

/* Adjust app-container padding since floating bottom bar is gone */
@media (max-width: 768px) {
    .app-container {
        padding: 0.5rem !important; /* Back to normal, drawer-nav doesn't block content */
    }
}

/* Split Email Display Card */
.email-display-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(11, 15, 25, 0.5);
    border: 1px solid var(--border-glass);
    padding: 0.5rem;
    border-radius: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

body.light-theme .email-display-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(79, 70, 229, 0.15);
}

.email-address-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    overflow: hidden;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .email-address-wrapper {
        font-size: 1.15rem; /* Slightly smaller text on narrow phone screens to avoid overflow */
        padding: 0.5rem 0.25rem;
    }
}

.email-part-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px dashed transparent;
    padding: 0 0.1rem;
    border-radius: 0.25rem;
}

/* Hover style: color changes to primary theme color, subtle dashed underline */
.email-part-clickable:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}
body.light-theme .email-part-clickable:hover {
    background: rgba(79, 70, 229, 0.05);
}

.email-part-at {
    color: var(--text-muted);
    padding: 0 0.05rem;
    user-select: none;
}

/* Server Switch Container inside Navigation Drawer */
.server-switch-container {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.25rem;
    border-radius: 0.75rem;
    gap: 0.25rem;
    width: 100%;
}

.server-switch-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.55rem 0.5rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.server-switch-btn i {
    width: 1rem;
    height: 1rem;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s;
}

.server-switch-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
}

.server-switch-btn:hover i {
    color: #fff;
}

/* Active Server Button Pill layout */
.server-switch-btn.active {
    background: #ffffff !important;
    color: #0f172a !important; /* Slate 900 dark text */
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.server-switch-btn.active i {
    color: #0f172a !important;
}

/* Dashboard Akun Styles */
.dashboard-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.dash-feature-item {
    transition: all 0.2s ease;
}

.dash-feature-item:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* User Role Badges */
.user-role-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-basic {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.badge-business,
.badge-standard {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #fff;
}

.badge-premium {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #000;
}

/* Admin Users Table Styles */
.admin-users-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.admin-users-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.admin-role-select option {
    background: #0f172a; /* Make dropdown options readable on dark glass theme */
    color: #fff;
}

/* ==========================================================================
   MONOCHROME HEADER & BODY THEME REPLICAS (BLACK & WHITE)
   ========================================================================== */
body {
    font-family: var(--font-body);
    transition: background-color var(--transition-normal) ease, color var(--transition-normal) ease;
}

body.light-theme {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    background-image: none !important;
}

body:not(.light-theme) {
    background-color: #030712 !important;
    color: #f3f4f6 !important;
    background-image: none !important;
}

.bg-glow {
    display: none !important;
}

.app-container {
    max-width: 1200px;
    padding: 0 0 2rem 0 !important;
    gap: 0 !important;
}

@media (max-width: 768px) {
    .app-container {
        padding: 0 !important;
    }
}

/* Theme Adaptive Top Merged Section */
body.light-theme .app-header {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-bottom: none !important;
    border-radius: 1.5rem 1.5rem 0 0 !important;
    margin-bottom: 0 !important;
    padding: 1.5rem 2rem !important;
    box-shadow: none !important;
}

body:not(.light-theme) .app-header {
    background: #0b0f19 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: none !important;
    border-radius: 1.5rem 1.5rem 0 0 !important;
    margin-bottom: 0 !important;
    padding: 1.5rem 2rem !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

@media (max-width: 768px) {
    .app-header {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
}

/* Logo and text adaptive */
body.light-theme .logo-text h1 {
    color: #0f172a !important;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

body:not(.light-theme) .logo-text h1 {
    color: #ffffff !important;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

body.light-theme .logo-text p {
    color: #64748b !important;
}

body:not(.light-theme) .logo-text p {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Glass buttons adaptive */
body.light-theme .btn-icon.glass {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body:not(.light-theme) .btn-icon.glass {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

body.light-theme .btn-icon.glass:hover {
    background: #e2e8f0 !important;
}

body:not(.light-theme) .btn-icon.glass:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Adaptive generator section */
body.light-theme .generator-section {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-top: none !important;
    border-radius: 0 0 1.5rem 1.5rem !important;
    padding: 1.5rem 2rem 2.5rem 2rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
    margin-bottom: 2rem !important;
    gap: 1.5rem !important;
}

body:not(.light-theme) .generator-section {
    background: #0b0f19 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top: none !important;
    border-radius: 0 0 1.5rem 1.5rem !important;
    padding: 1.5rem 2rem 2.5rem 2rem !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 2rem !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    gap: 1.5rem !important;
}

@media (max-width: 768px) {
    .generator-section {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        padding: 1.25rem 1.25rem 2rem 1.25rem !important;
        margin-bottom: 0 !important;
    }
}

/* Select-style Email address Display */
body.light-theme .email-display-card-wrapper {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

body:not(.light-theme) .email-display-card-wrapper {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.email-display-card-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.5rem;
    border-radius: 0.85rem;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
}

body.light-theme .email-display-card-wrapper:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

body:not(.light-theme) .email-display-card-wrapper:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

body.light-theme .email-address-full {
    color: #0f172a;
}

body:not(.light-theme) .email-address-full {
    color: #ffffff;
}

.email-address-full {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .email-address-full {
        font-size: 1.15rem;
    }
}

body.light-theme .dropdown-chevron {
    color: #64748b;
}

body:not(.light-theme) .dropdown-chevron {
    color: rgba(255, 255, 255, 0.8);
}

.dropdown-chevron {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* 4-button action grid card layout */
.generator-actions {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
    width: 100%;
}

@media (max-width: 480px) {
    .generator-actions {
        gap: 0.5rem !important;
    }
}

body.light-theme .action-card-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body:not(.light-theme) .action-card-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.action-card-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.35rem 0.5rem;
    border-radius: 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    outline: none;
    box-shadow: none;
}

body.light-theme .action-card-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-2px);
}

body:not(.light-theme) .action-card-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

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

.action-card-btn i {
    width: 1.35rem;
    height: 1.35rem;
    stroke-width: 2.2;
}

/* Progress bar inside blue section */
body.light-theme .progress-bar-container {
    background: #e2e8f0 !important;
}

body:not(.light-theme) .progress-bar-container {
    background: rgba(255, 255, 255, 0.15) !important;
}

body.light-theme .progress-bar {
    background: #0f172a !important;
}

body:not(.light-theme) .progress-bar {
    background: #ffffff !important;
}

/* White bottom section layout */
.mail-section {
    padding: 0 2rem !important;
}

@media (max-width: 768px) {
    .mail-section {
        padding: 1rem !important;
    }
}

/* Theme Adaptive Pane container */
body.light-theme .inbox-pane, 
body.light-theme .reader-pane {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
    color: #0f172a !important;
    border-radius: 1.5rem !important;
}

body:not(.light-theme) .inbox-pane, 
body:not(.light-theme) .reader-pane {
    background: #0b0f19 !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
    color: #f3f4f6 !important;
    border-radius: 1.5rem !important;
}

/* Theme Adaptive Header in pane */
body.light-theme .pane-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

body:not(.light-theme) .pane-header {
    border-bottom: 1px solid var(--border-glass) !important;
}

body.light-theme .pane-header h2 {
    color: #0f172a !important;
}

body:not(.light-theme) .pane-header h2 {
    color: #f3f4f6 !important;
}

body.light-theme .badge {
    background: #0f172a !important;
    color: #ffffff !important;
}

body:not(.light-theme) .badge {
    background: #ffffff !important;
    color: #0b0f19 !important;
}

body.light-theme .inbox-list {
    background: #ffffff !important;
}

body:not(.light-theme) .inbox-list {
    background: #0b0f19 !important;
}

/* Theme Adaptive Email item */
body.light-theme .email-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body:not(.light-theme) .email-item {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--border-glass) !important;
}

body.light-theme .email-item:hover {
    background: #f1f5f9 !important;
}

body:not(.light-theme) .email-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

body.light-theme .email-item.active {
    background: rgba(15, 23, 42, 0.05) !important;
    border-color: #0f172a !important;
    border-left-color: #0f172a !important;
}

body:not(.light-theme) .email-item.active {
    background: var(--primary-glow) !important;
    border-color: var(--primary) !important;
    border-left-color: var(--primary) !important;
}

body.light-theme .email-sender {
    color: #475569 !important;
}

body:not(.light-theme) .email-sender {
    color: #9ca3af !important;
}

body.light-theme .email-item.unread .email-sender {
    color: #0f172a !important;
}

body:not(.light-theme) .email-item.unread .email-sender {
    color: #ffffff !important;
}

body.light-theme .email-subject {
    color: #0f172a !important;
}

body:not(.light-theme) .email-subject {
    color: #ffffff !important;
}

body.light-theme #expiry-timer {
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    background: #f1f5f9 !important;
}

body:not(.light-theme) #expiry-timer {
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Custom domain addition button inside modal styling */
#btn-add-domain {
    border: 1px solid var(--border-glass) !important;
    color: var(--text-main) !important;
    background: var(--secondary) !important;
}

#btn-add-domain:hover {
    background: var(--secondary-hover) !important;
}

/* ==========================================================================
   SMOOTH TRANSITIONS & MICRO-ANIMATIONS FOR THEMING
   ========================================================================== */
body, 
.app-header, 
.generator-section, 
.inbox-pane, 
.reader-pane, 
.action-card-btn, 
.email-display-card-wrapper,
.email-item,
.pane-header,
.badge,
.logo-text h1,
.logo-text p,
.btn-icon.glass,
.admin-users-card,
.admin-stat-card,
.admin-role-select,
.admin-user-avatar {
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#theme-toggle i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

#theme-toggle:hover i {
    transform: scale(1.1) rotate(15deg);
}

/* ==========================================================================
   PREMIUM USER & ROLE MANAGEMENT STYLING
   ========================================================================== */
body.light-theme .admin-users-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
    color: #0f172a !important;
}

body:not(.light-theme) .admin-users-card {
    background: #0b0f19 !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
    color: #f3f4f6 !important;
}

.admin-users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.admin-users-table th {
    padding: 1rem 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

body.light-theme .admin-users-table th {
    color: #64748b;
    border-bottom: 1px solid #cbd5e1;
}

body:not(.light-theme) .admin-users-table th {
    color: #9ca3af;
    border-bottom: 1px solid var(--border-glass);
}

.admin-users-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

body.light-theme .admin-users-table td {
    border-bottom: 1px solid #e2e8f0;
}

body:not(.light-theme) .admin-users-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

body.light-theme .admin-users-table tbody tr:hover td {
    background: #f8fafc;
}

body:not(.light-theme) .admin-users-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* User avatar cell */
.admin-username-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.admin-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

body.light-theme .admin-user-avatar {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

body:not(.light-theme) .admin-user-avatar {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Premium Adaptive Dropdown Role select */
.admin-role-select {
    padding: 0.4rem 1.5rem 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 0.75rem;
}

body.light-theme .admin-role-select {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body:not(.light-theme) .admin-role-select {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: #ffffff;
}

body.light-theme .admin-role-select:hover {
    border-color: #94a3b8;
    background-color: #e2e8f0;
}

body:not(.light-theme) .admin-role-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.08);
}

/* Premium Rounded Pill Badges */
.user-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-basic {
    background: rgba(148, 163, 184, 0.1) !important;
    color: #64748b !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
}

.badge-standard {
    background: rgba(14, 165, 233, 0.1) !important;
    color: #0ea5e9 !important;
    border: 1px solid rgba(14, 165, 233, 0.15) !important;
}

.badge-premium {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.15) !important;
}



