/* 
 * SirAbody TempMail - Premium Dark Theme
 * Version: 6.0
 * Inspired by modern glass-morphism design
 */

/* ===== CSS Variables ===== */
:root {
    /* Primary Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #16161e;
    
    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --text-muted: #4a4a4a;
    
    /* Accent Colors */
    --accent-primary: #8b5cf6;
    --accent-secondary: #6366f1;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-cyan: #06b6d4;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-bg: linear-gradient(180deg, #0a0a0f 0%, #12121a 50%, #0a0a0f 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
    --shadow-glow-strong: 0 0 60px rgba(139, 92, 246, 0.25);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== Background Effects ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 0% 100%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Animated Grid Background */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.5); }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===== Layout ===== */
main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-bottom: 100px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    animation: fadeIn 0.6s ease;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding-top: var(--space-xl);
    animation: fadeInDown 0.6s ease;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.version-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--accent-primary);
    -webkit-text-fill-color: var(--accent-primary);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.description {
    font-size: 0.95rem;
    color: var(--text-tertiary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== Auth Section ===== */
.auth-section {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1000;
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    animation: fadeIn 0.6s ease 0.3s both;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.auth-btn:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.auth-btn.primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.auth-btn.primary:hover {
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.auth-btn i {
    font-size: 1rem;
}

/* User Info - Improved Profile Card */
.user-info-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.user-info-header:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 80px;
}

.user-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.user-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-right: var(--space-sm);
}

.user-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.user-action-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

.user-action-btn.logout-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

/* ===== Glass Card ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg);
}

/* ===== Email Generator ===== */
.email-generator {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.6s ease 0.2s both;
    position: relative;
    overflow: hidden;
}

.email-generator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.5;
}

.generator-content {
    position: relative;
    z-index: 1;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.form-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-xl);
}

/* Input Group */
.input-group {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    margin-bottom: var(--space-lg);
}

.input-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.email-input {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.email-input::placeholder {
    color: var(--text-tertiary);
}

.domain {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
    border-left: 1px solid var(--glass-border);
    white-space: nowrap;
}

.generate-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: var(--gradient-primary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.generate-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

.generate-btn i {
    font-size: 1.1rem;
}

/* Expiry Selector */
.expiry-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.expiry-selector label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.expiry-select {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.expiry-select:hover,
.expiry-select:focus {
    border-color: var(--accent-primary);
}

.expiry-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ===== Email Section ===== */
.email-section {
    animation: fadeInUp 0.6s ease;
}

.email-section.hidden {
    display: none;
}

/* Email Card */
.email-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.email-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-success);
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.email-info h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.email-address {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.email-address span {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.copy-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

/* Email Status */
.email-status {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-sm);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    color: var(--accent-green);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: var(--accent-green);
}

.expiry-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-yellow);
    font-variant-numeric: tabular-nums;
}

/* Email Actions */
.email-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

/* Fix: Allow clicks to pass through child elements to the button */
.action-btn > * {
    pointer-events: none;
}

.action-btn:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.action-btn.primary:hover {
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.action-btn.hidden {
    display: none;
}

.action-btn i {
    font-size: 0.9rem;
}

/* ===== Messages Section ===== */
.messages-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

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

.messages-header h4 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.messages-header h4 i {
    color: var(--accent-primary);
}

.message-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    margin-right: var(--space-sm);
}

/* Auto Refresh Toggle */
.auto-refresh {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.slider::before {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

input:checked + .slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

input:checked + .slider::before {
    background: white;
    transform: translateX(20px);
}

/* Messages Container */
.messages-container {
    max-height: none;
    min-height: 200px;
    overflow-y: auto;
}

.no-messages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-tertiary);
}

.no-messages i {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.no-messages p {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.no-messages small {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Message Item */
.message-item {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

.message-item:last-child {
    border-bottom: none;
}

.message-item.unread {
    background: rgba(139, 92, 246, 0.05);
    border-right: 3px solid var(--accent-primary);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.message-from {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.message-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.message-subject {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.message-preview {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Message Body - Expanded View */
.message-body {
    margin-top: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
    max-height: 600px;
    overflow-y: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-body.hidden {
    display: none;
}

.message-item.expanded {
    background: var(--glass-bg-hover);
}

.message-item.expanded .message-preview {
    display: none;
}

/* Fix email content colors */
.message-body * {
    color: inherit !important;
    background-color: transparent !important;
}

.message-body a {
    color: var(--accent-primary) !important;
    text-decoration: underline;
}

/* Smart text direction for messages */
.message-from[dir="ltr"],
.message-subject[dir="ltr"],
.message-preview[dir="ltr"],
.message-body[dir="ltr"] {
    text-align: left;
    direction: ltr;
}

.message-from[dir="rtl"],
.message-subject[dir="rtl"],
.message-preview[dir="rtl"],
.message-body[dir="rtl"] {
    text-align: right;
    direction: rtl;
}

.message-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.message-body table {
    width: 100%;
    border-collapse: collapse;
}

.message-body td, .message-body th {
    padding: var(--space-sm);
    border: 1px solid var(--glass-border);
}

/* ===== Footer - Improved Design ===== */
.footer {
    text-align: center;
    padding: 50px 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    margin-top: 80px;
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.5) 100%);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.footer p {
    margin: 0;
    line-height: 1.8;
}

.footer p:first-child {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer p:last-child {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}

.footer .heart {
    color: var(--accent-red);
    font-size: 1.2rem;
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.15); }
    50% { transform: scale(1); }
    75% { transform: scale(1.15); }
}

/* ===== Discord Button ===== */
.discord-btn {
    position: fixed;
    bottom: var(--space-xl);
    left: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    background: #5865F2;
    border-radius: var(--radius-full);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.4);
    transition: all var(--transition-normal);
    z-index: 1000;
}

.discord-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(88, 101, 242, 0.5);
}

.discord-btn i {
    font-size: 1.2rem;
}

/* ===== Language Toggle ===== */
.language-toggle {
    position: fixed;
    top: var(--space-lg);
    left: var(--space-lg);
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.language-toggle:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

.toast.success {
    border-right: 3px solid var(--accent-green);
}

.toast.error {
    border-right: 3px solid var(--accent-red);
}

.toast.warning {
    border-right: 3px solid var(--accent-yellow);
}

.toast.info {
    border-right: 3px solid var(--accent-blue);
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i { color: var(--accent-green); }
.toast.error i { color: var(--accent-red); }
.toast.warning i { color: var(--accent-yellow); }
.toast.info i { color: var(--accent-blue); }

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.toast-close {
    padding: var(--space-xs);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

/* ===== Hidden Utility ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: var(--space-lg) var(--space-md);
    }
    
    .header {
        padding-top: 80px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .auth-section {
        top: var(--space-md);
        right: var(--space-md);
        flex-wrap: wrap;
        max-width: calc(100% - 100px);
        justify-content: flex-end;
    }
    
    .language-toggle {
        top: var(--space-md);
        left: var(--space-md);
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .email-generator {
        padding: var(--space-xl);
    }
    
    .input-group {
        flex-direction: column;
        background: transparent;
        border: none;
        gap: var(--space-sm);
    }
    
    .email-input {
        background: var(--bg-tertiary);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-md);
        padding: var(--space-md);
    }
    
    .domain {
        background: var(--bg-tertiary);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-md);
        border-left: none;
        text-align: center;
    }
    
    .generate-btn {
        width: 100%;
        justify-content: center;
        border-radius: var(--radius-md);
        padding: var(--space-md);
    }
    
    .email-header {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .email-status {
        align-items: flex-start;
    }
    
    .email-actions {
        justify-content: center;
    }
    
    .discord-btn {
        bottom: var(--space-md);
        left: var(--space-md);
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .toast-container {
        bottom: var(--space-md);
        right: var(--space-md);
        left: var(--space-md);
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .logo {
        font-size: 1.6rem;
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .version-badge {
        font-size: 0.65rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .description {
        font-size: 0.85rem;
    }
    
    .form-title {
        font-size: 1.2rem;
    }
    
    .form-subtitle {
        font-size: 0.85rem;
    }
    
    .email-address span {
        font-size: 1rem;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .action-btn span {
        display: none;
    }
    
    .action-btn i {
        margin: 0;
    }
    
    .messages-header {
        flex-direction: column;
        gap: var(--space-md);
        align-items: flex-start;
    }
    
    .message-header {
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .auth-section {
        position: static;
        justify-content: center;
        padding: var(--space-md);
        max-width: none;
    }
    
    .header {
        padding-top: var(--space-md);
    }
}

/* ===== RTL Support ===== */
[dir="rtl"] .email-section .email-card::before,
[dir="rtl"] .message-item.unread {
    border-right: none;
    border-left: 3px solid var(--accent-primary);
}

[dir="rtl"] .toast.success,
[dir="rtl"] .toast.error,
[dir="rtl"] .toast.warning,
[dir="rtl"] .toast.info {
    border-right: none;
}

[dir="rtl"] .toast.success { border-left: 3px solid var(--accent-green); }
[dir="rtl"] .toast.error { border-left: 3px solid var(--accent-red); }
[dir="rtl"] .toast.warning { border-left: 3px solid var(--accent-yellow); }
[dir="rtl"] .toast.info { border-left: 3px solid var(--accent-blue); }

/* ❌ إزالة - الأزرار الثابتة لا تتأثر بـ RTL */
/* auth-section, language-toggle, discord-btn تبقى في مكانها */

/* ===== Fixed Position Elements (لا تتأثر بـ RTL) ===== */
.logo {
    direction: ltr !important;
    unicode-bidi: bidi-override;
}

.version-badge {
    direction: ltr !important;
}

.auth-section {
    right: var(--space-lg) !important;
    left: auto !important;
    direction: ltr !important;
    flex-direction: row !important;
}

.auth-section .auth-btn,
.auth-section .user-info {
    direction: ltr !important;
}

.language-toggle {
    left: var(--space-lg) !important;
    right: auto !important;
}

.discord-btn {
    left: var(--space-xl) !important;
    right: auto !important;
}

/* ===== Email Generator - لا تتأثر بـ RTL ===== */
.email-generator,
.email-generator .input-group {
    direction: ltr !important;
}

.email-generator .email-input,
.email-generator .domain,
.email-generator .generate-btn,
#domainDisplay {
    direction: ltr !important;
}

/* Fix input group flex direction */
.email-generator .input-group {
    flex-direction: row !important;
}

/* Keep placeholder readable */
.email-generator .email-input::placeholder {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] .email-generator .email-input::placeholder {
    direction: ltr;
    text-align: left;
}

@media (max-width: 768px) {
    .auth-section {
        right: var(--space-md) !important;
    }
    
    .language-toggle {
        left: var(--space-md) !important;
    }
    
    .discord-btn {
        left: var(--space-md) !important;
    }
}

/* ===== Clear Inbox Button ===== */
.messages-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.clear-inbox-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-inbox-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

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

.clear-inbox-btn i {
    font-size: 0.75rem;
}

/* ===== OTP Button Styles - Enhanced ===== */
.otp-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%) !important;
    color: white !important;
    font-weight: 700 !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4), 0 0 0 0 rgba(16, 185, 129, 0.4) !important;
    position: relative;
    overflow: hidden;
}

.otp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.otp-btn:hover::before {
    left: 100%;
}

.otp-btn:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5), 0 0 20px rgba(16, 185, 129, 0.3) !important;
}

.otp-btn:active {
    transform: translateY(-1px) scale(1) !important;
}

.otp-btn i {
    font-size: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.otp-btn .otp-code {
    font-family: 'JetBrains Mono', 'Monaco', 'Consolas', monospace !important;
    font-size: 1.3rem !important;
    letter-spacing: 3px !important;
    background: rgba(255, 255, 255, 0.25) !important;
    padding: 4px 12px !important;
    border-radius: 8px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-weight: 800 !important;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4), 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(16, 185, 129, 0.6), 0 0 15px rgba(16, 185, 129, 0.4);
    }
}

@keyframes otpGlow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 4px 35px rgba(16, 185, 129, 0.7), 0 0 25px rgba(16, 185, 129, 0.5);
    }
}

/* ===== Custom Confirm Modal ===== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
}

.custom-modal {
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.98), rgba(20, 20, 30, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 0;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.15);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.custom-modal-overlay.show .custom-modal {
    transform: scale(1) translateY(0);
}

.custom-modal-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
    padding: 16px 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.custom-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.custom-modal-body {
    padding: 24px 20px;
    text-align: center;
}

.custom-modal-body p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0;
    line-height: 1.6;
}

.custom-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.modal-btn-confirm:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* ===== Print Styles ===== */
@media print {
    body::before,
    body::after,
    .auth-section,
    .language-toggle,
    .discord-btn,
    .toast-container,
    .loading-spinner {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .glass-card,
    .email-generator,
    .email-card,
    .messages-section {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}
