/* ==========================================================================
   Design System & Variable Declarations
   ========================================================================== */
:root {
    --bg-primary: #f8fafc; /* Very light cool grey */
    --bg-secondary: #f1f5f9; /* Soft light slate */
    --glass-bg: rgba(255, 255, 255, 0.7); /* Clear white glass */
    --glass-border: rgba(99, 102, 241, 0.12); /* Subtle indigo border */
    --glass-highlight: rgba(255, 255, 255, 0.6);
    
    --primary: #4f46e5; /* Premium Indigo */
    --primary-glow: rgba(79, 70, 229, 0.12);
    --secondary: #7c3aed; /* Violet */
    --accent: #059669; /* Emerald/Mint (high contrast) */
    --accent-glow: rgba(5, 150, 105, 0.12);
    --danger: #dc2626; /* Coral Red */
    
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #475569; /* Slate 600 */
    --text-dark: #64748b; /* Slate 500 */
    
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Theme Adaptations */
    --input-bg: rgba(255, 255, 255, 0.85);
    --card-bg: rgba(255, 255, 255, 0.65);
    --border-subtle: rgba(0, 0, 0, 0.05);
    --hover-bg: rgba(99, 102, 241, 0.04);
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(124, 58, 237, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   App Layout
   ========================================================================== */
.app-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    width: 100%;
    height: 72px;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
    margin-bottom: 24px;
}

.header-inner {
    max-width: 1400px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.brand h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.brand h1 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 6px 14px;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #059669;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 8px #059669;
    animation: pulse 2s infinite;
}

.status-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #047857;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Main */
.app-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 24px;
    align-items: start;
    padding-bottom: 24px;
}

.main-content-area {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* ==========================================================================
   Reusable Components (Glassmorphism & Buttons)
   ========================================================================== */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.05);
    overflow: hidden;
    position: relative;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
    z-index: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    user-select: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

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

.btn-secondary:hover {
    background: var(--btn-secondary-hover-bg);
    border-color: var(--btn-secondary-border-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: rgba(99, 102, 241, 0.05);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-icon-only {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--border-radius-md);
    background: var(--btn-secondary-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.btn-icon-only:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

/* Badge */
.badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ==========================================================================
   Generator Panel Section
   ========================================================================== */
.generator-section {
    display: flex;
    justify-content: center;
}

.generator-card {
    width: 100%;
    max-width: 100%;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.generator-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.email-input-wrapper {
    display: flex;
    width: 100%;
    gap: 12px;
    align-items: center;
}

.custom-email-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 0 16px;
    height: 52px;
    box-shadow: var(--input-shadow);
    transition: var(--transition-normal);
    overflow: hidden;
}

.custom-email-box:focus-within {
    border-color: var(--primary);
    box-shadow: var(--input-shadow), 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.mail-icon-inside {
    color: var(--text-muted);
    margin-right: 10px;
    flex-shrink: 0;
}

.email-display-prefix {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: left;
    padding: 0;
    min-width: 80px;
}

.email-domain-tag {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    padding-left: 2px;
    user-select: none;
    flex-shrink: 0;
}

.email-input-wrapper .btn {
    height: 52px;
    border-radius: var(--border-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.email-input-wrapper .btn-icon-only {
    width: 52px;
    min-width: 52px;
    padding: 0;
}

.generator-meta {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--glass-border);
}

/* Countdown Progress Ring */
.countdown-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
    stroke-linecap: round;
}

.countdown-text {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.meta-controls {
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   Inbox Workspace Section
   ========================================================================== */
.inbox-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.inbox-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    flex: 1;
    min-height: 550px;
}

/* General Inbox Header */
.inbox-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inbox-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.spin-icon {
    animation: spin 0.75s linear infinite;
}

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

/* Left Column: Mail List */
.list-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.email-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Empty State */
.empty-inbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    flex: 1;
    color: var(--text-muted);
}

.empty-icon {
    color: var(--text-dark);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-inbox h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-inbox p {
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 250px;
}

/* Email List Item Cards */
.email-item {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    border-left: 3px solid transparent;
}

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

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

.email-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.email-item-sender {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.email-item-time {
    font-size: 0.75rem;
    color: var(--text-dark);
}

.email-item-delete-btn {
    background: transparent;
    border: none;
    padding: 3px 5px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    opacity: 0.6;
}

.email-item:hover .email-item-delete-btn {
    opacity: 1;
}

.email-item-delete-btn:hover {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.12);
}

.email-item-subject {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.email-item-body-preview {
    font-size: 0.78rem;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right Column: Mail Details View */
.detail-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.unselected-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.unselected-icon {
    color: var(--text-dark);
    margin-bottom: 16px;
    opacity: 0.4;
}

.unselected-message h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 8px;
}

.unselected-message p {
    font-size: 0.85rem;
    max-width: 320px;
}

/* Email Viewer Main Content */
.email-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.email-viewer-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.01);
}

.view-subject {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.sender-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sender-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.sender-details {
    display: flex;
    flex-direction: column;
}

.sender-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sender-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-main);
}

.sender-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timestamp {
    font-size: 0.75rem;
    color: var(--text-dark);
    display: flex;
    gap: 4px;
}

/* Safe Sandbox Iframe */
.email-viewer-body {
    flex: 1;
    padding: 0;
    position: relative;
    background: #ffffff; /* Contrast background for typical email content rendering */
    border-bottom-left-radius: var(--border-radius-lg);
    border-bottom-right-radius: var(--border-radius-lg);
}

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

/* ==========================================================================
   Skeleton Loading State
   ========================================================================== */
.skeleton-item {
    padding: 20px;
    display: none; /* activated in JS */
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.skeleton-line {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-line::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    animation: shimmer 1.5s infinite;
}

.skeleton-line.title {
    width: 60%;
    height: 14px;
}

.skeleton-line.text {
    width: 90%;
    height: 10px;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==========================================================================
   Modal Dialog Styles
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    border: 1px solid var(--glass-border);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

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

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

.modal-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.form-control[readonly] {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-dark);
    cursor: not-allowed;
    border-style: dashed;
}

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

.form-help {
    font-size: 0.72rem;
    color: var(--text-dark);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

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

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 300;
    pointer-events: none;
}

.toast {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--primary);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: auto;
    animation: slideInRight 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    min-width: 250px;
}

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

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

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.toast-fade-out {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #020617;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

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

/* ==========================================================================
   Sidebar & History Panel Styles
   ========================================================================== */
.history-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    max-height: 600px;
    border: 1px solid var(--glass-border);
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.history-item {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
}

.history-item:hover {
    background: var(--hover-bg);
}

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

.history-item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.history-item-address {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-expiry {
    font-size: 0.7rem;
    color: var(--text-dark);
}

.history-item-actions {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.history-item-delete {
    background: transparent;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item-delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

.empty-history {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.8rem;
}

/* ==========================================================================
   Google Ads Space Styles
   ========================================================================== */
.ad-space {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.ad-space.top-ad-banner {
    margin-top: 0;
    margin-bottom: 24px;
}

.ad-space.bottom-ad-banner {
    margin-top: 24px;
    margin-bottom: 0;
}

.ad-placeholder {
    width: 100%;
    max-width: 970px;
    height: 90px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-dark);
    text-align: center;
    transition: var(--transition-normal);
    padding: 8px;
}

.ad-placeholder:hover {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.02);
}

.ad-tag {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
}

.ad-desc {
    font-size: 0.72rem;
    color: var(--text-dark);
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-sidebar {
    height: 100%;
    position: sticky;
    top: 104px;
}

.side-ad-skyscraper {
    height: 600px;
    width: 100%;
}

.ad-placeholder.vertical {
    height: 100%;
    max-width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.ad-placeholder.vertical .ad-desc {
    white-space: normal;
    line-height: 1.4;
}

/* ==========================================================================
   SEO Content & FAQ Section
   ========================================================================== */
.seo-content-section {
    margin-top: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    border: 1px solid var(--glass-border);
}

.seo-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.seo-header h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.seo-header p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.seo-main-question {
    background: var(--card-bg);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--border-radius-md);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.seo-main-question h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 14px;
}

.seo-main-question p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.seo-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 28px;
    transition: var(--transition-normal);
}

.seo-card:hover {
    background: var(--card-hover-bg);
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateY(-3px);
}

.seo-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.05);
}

.seo-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.seo-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.faq-accordion-container {
    margin-top: 16px;
    padding-top: 32px;
    border-top: 1px solid var(--glass-border);
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 16px 24px;
    transition: var(--transition-normal);
}

.faq-item:hover {
    background: var(--card-hover-bg);
    border-color: var(--glass-border);
}

.faq-question {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-question::after {
    content: '+';
    font-size: 1.4rem;
    color: var(--primary);
    transition: transform var(--transition-normal);
    font-weight: 400;
}

.faq-item.open {
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.02);
}

.faq-item.open .faq-question::after {
    content: '−';
    transform: rotate(180deg);
}

.faq-answer {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
    margin-top: 12px;
    display: none;
    animation: fadeIn 0.25s ease;
}

.faq-item.open .faq-answer {
    display: block;
}

/* Generator Active Status Info */
.generator-info-text {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.status-badge {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.05);
}

.status-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   Media Queries & Responsive Scaling
   ========================================================================== */
@media (max-width: 1200px) {
    .app-main {
        grid-template-columns: 260px 1fr;
    }
    .right-ad-sidebar {
        display: none;
    }
    .ad-placeholder {
        max-width: 728px;
    }
}

@media (max-width: 992px) {
    .inbox-container {
        grid-template-columns: 1fr;
        grid-template-rows: 280px 400px;
    }
}

@media (max-width: 850px) {
    .app-main {
        grid-template-columns: 1fr;
    }
    .history-sidebar {
        max-height: 250px;
        min-height: auto;
    }
}

@media (max-width: 576px) {
    body {
        padding: 0;
    }
    
    .app-container {
        padding: 0 16px;
    }
    
    .app-header {
        height: auto;
    }
    
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 16px 0;
        gap: 12px;
        align-items: stretch;
    }
    
    .status-indicator {
        justify-content: center;
    }
    
    .header-actions {
        display: flex;
        justify-content: center;
    }
    
    .generator-card {
        padding: 20px 16px;
    }
    
    .email-display {
        font-size: 1.15rem;
        padding: 10px 12px;
    }
    
    .generator-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .ad-space.top-ad-banner, 
    .ad-space.bottom-ad-banner {
        display: none; /* Hide large banners on mobile screen */
    }
}

/* ==========================================================================
   Header Right Group & Nav Links
   ========================================================================== */
.header-right-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-normal);
}

.nav-link:hover {
    color: var(--primary);
}

.btn-link-style {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

/* ==========================================================================
   SEO Keywords Bar & Pills
   ========================================================================== */
.seo-keywords-bar {
    margin-bottom: 24px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.7);
}

.keywords-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.keywords-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kw-pill {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.18);
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    transition: var(--transition-normal);
    user-select: none;
}

.kw-pill:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--primary-glow);
}

/* ==========================================================================
   Modal Component (Terms & Conditions / Privacy)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

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

.modal-card {
    background: #ffffff;
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    animation: slideUp 0.25s ease-out;
    overflow: hidden;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
}

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

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 6px;
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.modal-body h4 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 6px;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 12px;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.modal-body li {
    margin-bottom: 4px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(0,0,0,0.08);
    display: flex;
    justify-content: flex-end;
    background: var(--bg-primary);
}

/* ==========================================================================
   Footer Enhancement
   ========================================================================== */
.app-footer {
    padding: 30px 0 40px 0;
    margin-top: 30px;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

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

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-link-btn:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.footer-divider {
    color: var(--text-dark);
    font-size: 0.75rem;
    opacity: 0.6;
}

