/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
}

[data-theme="dark"] .login-box,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .compose-form,
[data-theme="dark"] .email-detail {
    background: var(--card-bg);
}

[data-theme="dark"] .email-item:hover {
    background: #334155;
}

[data-theme="dark"] input,
[data-theme="dark"] .editor {
    background: #0f172a;
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .email-list {
    background: var(--card-bg);
}

[data-theme="dark"] .btn-sm {
    background: #334155;
    border-color: #475569;
    color: var(--text-primary);
}

[data-theme="dark"] .editor-toolbar {
    background: #334155;
    border-color: var(--border-color);
}

[data-theme="dark"] .editor-toolbar button {
    background: #1e293b;
    border-color: #475569;
    color: var(--text-primary);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.email-item {
    animation: fadeIn 0.3s ease forwards;
}

.email-item:nth-child(1) { animation-delay: 0s; }
.email-item:nth-child(2) { animation-delay: 0.05s; }
.email-item:nth-child(3) { animation-delay: 0.1s; }
.email-item:nth-child(4) { animation-delay: 0.15s; }
.email-item:nth-child(5) { animation-delay: 0.2s; }

.content-section.active {
    animation: fadeIn 0.3s ease;
}

.settings-card {
    animation: slideIn 0.4s ease forwards;
}

.settings-card:nth-child(1) { animation-delay: 0s; }
.settings-card:nth-child(2) { animation-delay: 0.1s; }
.settings-card:nth-child(3) { animation-delay: 0.2s; }
.settings-card:nth-child(4) { animation-delay: 0.3s; }

/* Pages */
.page {
    display: none;
}
.page.active {
    display: block;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    animation: gradientShift 15s ease infinite;
    background-size: 400% 400%;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-box {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    margin: 20px;
    animation: loginBoxIn 0.6s ease forwards;
}

@keyframes loginBoxIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.logo-modern {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-modern i {
    font-size: 36px;
    color: white;
    transform: rotate(-15deg);
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.domain-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Main Layout */
#main-page {
    display: none;
    height: 100vh;
}
#main-page.active {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 22px;
    font-weight: 700;
    border-bottom: none;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-logo i {
    font-size: 18px;
    color: white;
    transform: rotate(-15deg);
}

.user-info {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    margin: 10px;
    border-radius: 12px;
    border: none;
}

.avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.3px;
}

.user-email {
    font-size: 11px;
    opacity: 0.7;
    color: rgba(255,255,255,0.6);
}

.sidebar-nav {
    flex: 1;
    padding: 15px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.25s ease;
    font-weight: 500;
    position: relative;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    transform: translateX(5px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: white;
    border-radius: 0 4px 4px 0;
}

.nav-item.active {
    background: var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.badge {
    margin-left: auto;
    background: var(--primary-color);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    display: none;
    animation: badgeIn 0.3s ease;
}

@keyframes badgeIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.sidebar-footer {
    padding: 15px 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: 75px;
    background: var(--card-bg);
    border-bottom: none;
    display: flex;
    align-items: center;
    padding: 0 30px;
    gap: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
}

.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 15px;
    transition: color 0.3s;
}

.search-box:focus-within i {
    color: var(--primary-color);
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid transparent;
    background: var(--bg-color);
    border-radius: 14px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.content-section {
    display: none;
}
.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    font-size: 22px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Email List */
.email-list {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.email-item {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.email-item:hover {
    background: var(--bg-color);
    transform: translateX(5px);
    box-shadow: -3px 0 0 var(--primary-color);
}

.email-item:last-child {
    border-bottom: none;
}

.email-item.unread {
    background: rgba(99, 102, 241, 0.05);
}

.email-item.unread .email-subject {
    font-weight: 600;
}

.email-checkbox {
    margin-right: 15px;
}

.email-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    margin-right: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    transition: transform 0.2s ease;
}

.email-item:hover .email-avatar {
    transform: scale(1.05);
}

.email-content {
    flex: 1;
    min-width: 0;
}

.email-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.email-from {
    font-weight: 500;
    color: var(--text-primary);
}

.email-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.email-subject {
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Email actions container */
.email-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 100px;
    margin-left: 16px;
    flex-shrink: 0;
}

.email-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-sent {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Delete button */
.btn-delete {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-delete:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    animation: fadeIn 0.5s ease;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state p {
    font-size: 16px;
    margin-top: 10px;
}

/* Compose Form */
.compose-form {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-row input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.form-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.editor-toolbar {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.editor-toolbar button {
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-toolbar button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.editor-toolbar .separator {
    width: 1px;
    background: var(--border-color);
    margin: 0 5px;
}

.editor {
    min-height: 250px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-size: 14px;
    line-height: 1.6;
}

.editor:focus {
    outline: none;
    border-color: var(--primary-color);
}

.editor:empty:before {
    content: attr(placeholder);
    color: var(--text-secondary);
}

.checkbox-row {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Settings */
.settings-content {
    display: grid;
    gap: 20px;
}

.settings-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
}

.settings-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item .label {
    color: var(--text-secondary);
}

.setting-item .value {
    font-weight: 500;
}

/* Email Detail */
.email-detail {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
}

.email-detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.email-detail-subject {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
}

.email-detail-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.email-detail-body {
    line-height: 1.8;
    color: var(--text-primary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 100;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: block;
    }
    
    .top-bar {
        padding: 0 15px;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .compose-form {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* User management */
.users-list {
    margin-bottom: 20px;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.user-item .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-item .user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-item .user-name {
    font-weight: 500;
}

.user-item .user-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.add-user-form {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.add-user-form input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.add-user-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-danger {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

/* Email input group */
.email-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.email-input-group:focus-within {
    border-color: var(--primary-color);
}

.email-input-group input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 12px 15px !important;
    font-size: 15px;
}

.email-input-group input:focus {
    outline: none;
}

.at-symbol {
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0 5px;
}

.email-input-group select {
    border: none;
    background: transparent;
    padding: 12px 15px 12px 5px;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
}

.email-input-group select:focus {
    outline: none;
}

/* Random options */
.random-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-random {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-random:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.length-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

.length-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Preview email */
.preview-email {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-email i {
    color: var(--primary-color);
    font-size: 18px;
}

.preview-email span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

[data-theme="dark"] .email-input-group {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .length-select {
    background: #1e293b;
    border-color: #334155;
    color: var(--text-primary);
}

[data-theme="dark"] .preview-email {
    background: rgba(99, 102, 241, 0.15);
}

/* Header actions */
.header-actions {
    display: flex;
    gap: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Email detail actions */
.email-detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.email-detail-actions .btn {
    padding: 10px 20px;
}

/* Small danger button */
.btn-sm.btn-danger {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-size: 13px;
}

.btn-sm.btn-danger:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}
