/* AeroMail Premium Glassmorphic Design System */

:root {
    --bg-base: #0b0f19;
    --bg-sidebar: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    --secondary: #0ea5e9;
    --secondary-hover: #0284c7;
    --secondary-glow: rgba(14, 165, 233, 0.35);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-hover: #dc2626;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.05) 0px, transparent 60%);
    background-attachment: fixed;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Glassmorphism panel helper */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* Global Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 14px var(--secondary-glow);
}
.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

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

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

.btn-icon-only {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
}
.btn-icon-only:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

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

/* App Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar Navigation */
.app-sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}
.logo-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
}
.logo-text {
    color: var(--text-primary);
}
.logo-text span {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.system-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}
.status-dot.offline {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

/* Sidebar Information Card */
.sidebar-info-card {
    padding: 16px;
    margin-bottom: 20px;
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
}
.info-row:last-of-type {
    margin-bottom: 14px;
}
.info-label {
    color: var(--text-secondary);
}
.info-value {
    font-weight: 600;
    color: var(--text-primary);
}
.domain-badge {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-family: monospace;
}
.settings-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}
.settings-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.sidebar-actions .btn {
    width: 100%;
    padding: 12px;
}

/* Address List Management */
.address-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.section-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
}
.address-count-badge {
    background: var(--border-color);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--text-secondary);
}
.search-bar {
    position: relative;
    margin-bottom: 16px;
}
.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.search-bar input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 10px 10px 10px 36px;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border var(--transition-fast);
}
.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

.address-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
}

/* Address Card Item */
.address-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.address-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}
.address-card.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}
.address-details {
    flex: 1;
    overflow: hidden;
    margin-right: 8px;
}
.address-email-text {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.address-card.active .address-email-text {
    color: white;
}
.address-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.address-right-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.unread-dot {
    background: var(--secondary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.address-actions {
    display: flex;
    gap: 4px;
}
.address-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
}
.address-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.address-action-btn.del-btn:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 2rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-muted) 0%, var(--border-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.empty-state p {
    font-size: 0.9rem;
    line-height: 1.4;
}
.empty-state .small {
    font-size: 0.75rem;
    margin-top: 6px;
    display: block;
}

/* Main Content Area */
.app-main {
    height: 100%;
    overflow-y: auto;
    position: relative;
}

.dashboard-panel, .inbox-panel {
    padding: 32px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

.hidden {
    display: none !important;
}

/* Main Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 28px;
}
.main-header h1 {
    font-size: 2.2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 6px;
}
.gradient-text {
    background: linear-gradient(90deg, #a78bfa 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Dashboard Statistics Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}
.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
}
.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
}

/* Flowchart Section */
.dashboard-section {
    padding: 24px;
    margin-bottom: 24px;
}
.section-heading {
    font-size: 1.25rem;
    font-family: var(--font-heading);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}
.flowchart-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.flow-step {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}
.step-num {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}
.flow-step h4 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.flow-step p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.flow-arrow {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* DNS Setup Guide Card & Table */
.alert-info-box {
    background: rgba(99, 102, 241, 0.05);
    border-left: 4px solid var(--primary);
    padding: 18px;
    border-radius: 0 8px 8px 0;
}
.alert-info-box h5 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-info-box p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.dns-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 0.85rem;
}
.dns-table th, .dns-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dns-table th {
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
.dns-table td code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    color: #a78bfa;
    font-family: monospace;
    font-size: 0.85rem;
}
.dns-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    text-align: center;
    display: inline-block;
}
.dns-badge.mx { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.4); }
.dns-badge.a { background: rgba(14, 165, 233, 0.2); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.4); }
.dns-badge.txt { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }

/* Inbox Dual-Pane Layout */
.inbox-split-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.4);
    height: calc(100vh - 160px);
    overflow: hidden;
}

/* Left Pane: Message list */
.email-list-pane {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.email-list-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.1);
}
.unread-pill {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
}
.email-list-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Inbox Mail Item Card */
.mail-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mail-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.mail-item.selected {
    background: rgba(99, 102, 241, 0.06);
    border-left: 3px solid var(--primary);
}
.mail-item.unread {
    font-weight: 600;
}
.mail-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mail-item-sender {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.mail-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.mail-item-subject {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mail-item.unread .mail-item-subject {
    color: white;
}
.mail-item-snippet {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Right Pane: Reading Pane */
.email-reading-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(0, 0, 0, 0.08);
}
.reading-pane-empty {
    margin: auto;
    text-align: center;
    padding: 40px;
    max-width: 420px;
    color: var(--text-muted);
}
.reading-pane-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--border-color);
}
.reading-pane-empty h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}
.reading-pane-empty p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Active Email Viewer */
.email-view-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    overflow-y: auto;
}

/* OTP Highlight Banner */
.otp-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(14, 165, 233, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.35);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
    animation: pulseGlow 3s infinite alternate;
}
.otp-badge {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.otp-details h3 {
    font-size: 1.15rem;
    margin-bottom: 4px;
    color: white;
}
.otp-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.otp-action-box {
    display: flex;
    align-items: center;
    gap: 12px;
}
.otp-code-value {
    font-family: 'Space Grotesk', monospace;
    font-size: 2.2rem;
    font-weight: 800;
    color: #22d3ee;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 16px;
    border-radius: 8px;
    border: 1px solid rgba(34, 211, 238, 0.2);
}
.btn-copy-otp {
    height: 48px;
    padding: 0 20px;
}

/* Email Details Header */
.email-details-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.email-subject-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.email-subject-row h2 {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
}
.email-meta-info {
    display: flex;
    gap: 12px;
    align-items: center;
}
.sender-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}
.sender-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.meta-row {
    font-size: 0.85rem;
    display: flex;
    gap: 6px;
}
.meta-label {
    color: var(--text-muted);
    min-width: 46px;
}
.meta-value {
    color: var(--text-secondary);
}
.meta-value.bold {
    color: var(--text-primary);
    font-weight: 600;
}

/* Tabs */
.body-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}
.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
}
.tab-btn:hover {
    color: var(--text-primary);
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}
#html-body-frame {
    width: 100%;
    flex: 1;
    border: none;
    background: white;
    border-radius: 6px;
    min-height: 400px;
}
#text-body-pre {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 6px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    flex: 1;
    overflow-y: auto;
}

/* Modal Overlays & Animation */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn var(--transition-fast) ease-out;
}
.modal-box {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    animation: slideUp var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.modal-box.large {
    max-width: 640px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    font-size: 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
}
.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.modal-close-btn:hover {
    color: var(--danger);
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.modal-intro {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
}

/* Forms styling inside modals */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.form-row {
    display: flex;
    gap: 16px;
}
.flex-1 {
    flex: 1;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--border-focus);
}
.input-suffix-group {
    display: flex;
    align-items: center;
}
.input-suffix-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-suffix {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-left: none;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.95rem;
}
.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Preset Buttons */
.simulator-presets {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.preset-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.preset-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all var(--transition-fast);
}
.preset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.preset-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-color: var(--primary);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    animation: slideIn var(--transition-fast) ease-out;
}
.toast-icon {
    font-size: 1.2rem;
}
.toast-icon.success { color: var(--success); }
.toast-icon.error { color: var(--danger); }
.toast-icon.info { color: var(--secondary); }
.toast-message {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Animations Definitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes pulseGlow {
    from { box-shadow: 0 0 10px rgba(99, 102, 241, 0.1); }
    to { box-shadow: 0 0 25px rgba(99, 102, 241, 0.3); }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 280px 1fr;
    }
    .flowchart-container {
        grid-template-columns: 1fr;
    }
    .flow-arrow {
        transform: rotate(90deg);
        margin: 6px auto;
    }
    .inbox-split-layout {
        grid-template-columns: 240px 1fr;
    }
}
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    .app-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: auto;
    }
    .inbox-split-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}
