:root {
    --primary-color: #006837;
    --primary-light: #008542;
    --primary-dark: #004d2b;
    --secondary-color: #00a651;
    --accent-color: #3399ff;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --background-light: #ffffff;
    --background-dark: #1f2937;
    --text-light: #1f2937;
    --text-dark: #f3f4f6;
    --border-light: #006837;
    --border-dark: #374151;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-dark: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --header-height: 70px;
    --transition-speed: 0.3s;
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.18);
    --message-1: var(--primary-color);
    --message-2: var(--secondary-color);
    --message-3: var(--accent-color);
    --message-4: var(--success-color);
    --message-5: var(--warning-color);
}

[data-theme="dark"] {
    --primary-color: #008542;
    --primary-light: #00a651;
    --primary-dark: #006837;
    --secondary-color: #66BB6A;
    --background-light: #1f2937;
    --background-dark: #111827;
    --text-light: #f3f4f6;
    --text-dark: #e5e7eb;
    --border-light: #374151;
    --border-dark: #4b5563;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-dark: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(31, 41, 55, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--background-light) 0%, #f0f9f0 100%);
    color: var(--text-light);
    transition: all var(--transition-speed) var(--transition-timing);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, var(--background-light) 0%, #1a2634 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    flex: 1;
    position: relative;
    z-index: 1;
}

header {
    background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
    padding: 0.5rem 0;
    box-shadow: var(--shadow-light);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    transition: all var(--transition-speed) var(--transition-timing);
}

header:hover {
    box-shadow: var(--shadow-medium);
}

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

.header-content > div {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-speed) var(--transition-timing);
}

.header-title:hover {
    transform: scale(1.05);
}

.logo {
    display: flex;
    align-items: center;
    transition: transform var(--transition-speed) var(--transition-timing);
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 50px;
    width: auto;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    transition: transform var(--transition-speed) var(--transition-timing);
    border-radius: 50%;
}

.menu-toggle:hover {
    transform: rotate(90deg);
    background-color: rgba(255, 255, 255, 0.1);
}

.side-menu {
    position: fixed;
    right: -100%;
    top: 0;
    width: 300px;
    height: 100vh;
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-medium);
    transition: right var(--transition-speed) var(--transition-timing);
    z-index: 999;
    overflow-y: auto;
    padding: calc(var(--header-height) + 1rem) 1rem 1rem 1rem;
    border-left: 1px solid var(--glass-border);
}

.side-menu.active {
    right: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.menu-items {
    list-style: none;
}

.menu-item {
    margin-bottom: 1rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all var(--transition-speed) var(--transition-timing);
    border-radius: 0.5rem;
}

.menu-link:hover, .menu-link.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(-5px);
}

.menu-link i {
    margin-left: 0.75rem;
    width: 20px;
    text-align: center;
}

.menu-close {
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) var(--transition-timing);
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-close:hover {
    background-color: var(--primary-light);
    transform: scale(1.1) rotate(90deg);
}

.submenu {
    list-style: none;
    margin-right: 2rem;
    margin-top: 0.5rem;
    display: none;
}

.submenu.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

.page-title-container {
    text-align: center;
    margin-bottom: 2rem;
    animation: slideInDown 0.5s ease;
    position: relative;
}

.help-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, var(--accent-color), #4da6ff);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(51, 153, 255, 0.3);
    margin-top: 0.5rem;
}

.help-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 153, 255, 0.4);
}

.page-title {
    color: var(--primary-color);
    font-size: 2rem;
    margin: 0;
    padding: 1rem 0;
    display: inline-block;
    position: relative;
}

.page-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--primary-color), transparent);
}

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

.stats-container {
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
    transition: transform var(--transition-speed) var(--transition-timing),
                box-shadow var(--transition-speed) var(--transition-timing);
}

.stats-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 0.8rem;
    border: 1px solid var(--glass-border);
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-speed) var(--transition-timing),
                box-shadow var(--transition-speed) var(--transition-timing);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.stat-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border-light);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
    transition: width 0.5s ease;
    border-radius: 6px;
}

.supabase-settings-panel {
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: var(--shadow-light);
    border: 2px solid #0d7377;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
    overflow: hidden;
}

.supabase-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.08), rgba(20, 163, 168, 0.04));
    transition: background var(--transition-speed) var(--transition-timing);
}

.supabase-settings-header:hover {
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.12), rgba(20, 163, 168, 0.08));
}

.supabase-settings-header h3 {
    margin: 0;
    color: #0d7377;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.supabase-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(244, 67, 54, 0.3);
    transition: all var(--transition-speed) var(--transition-timing);
}

.supabase-status-badge.configured {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border-color: rgba(76, 175, 80, 0.3);
}

.supabase-toggle-btn {
    background: none;
    border: none;
    color: #0d7377;
    font-size: 1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-shadow: none;
    transition: all var(--transition-speed) var(--transition-timing);
}

.supabase-toggle-btn:hover {
    background: rgba(13, 115, 119, 0.1);
    transform: none;
    box-shadow: none;
}

.supabase-settings-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 1.5rem;
}

.supabase-settings-body.open {
    max-height: 600px;
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.supabase-info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(13, 115, 119, 0.06);
    border: 1px solid rgba(13, 115, 119, 0.2);
    border-radius: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

.supabase-info-box i {
    color: #0d7377;
    font-size: 1.2rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.supabase-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.supabase-derived-url {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(13, 115, 119, 0.04);
    border: 1px dashed rgba(13, 115, 119, 0.3);
    border-radius: 0.5rem;
}

.supabase-derived-url label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #0d7377;
    font-size: 0.9rem;
}

.derived-url-display {
    direction: ltr;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    background: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: 0.4rem;
    color: var(--text-light);
    word-break: break-all;
    opacity: 0.8;
}

.supabase-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.supabase-test-result {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease;
}

.smtp-settings-panel {
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: var(--shadow-light);
    border: 2px solid var(--primary-color);
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
    overflow: hidden;
}

.smtp-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 104, 55, 0.08), rgba(0, 133, 66, 0.04));
    transition: background var(--transition-speed) var(--transition-timing);
}

.smtp-settings-header:hover {
    background: linear-gradient(135deg, rgba(0, 104, 55, 0.12), rgba(0, 133, 66, 0.08));
}

.smtp-settings-header h3 {
    margin: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.smtp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(244, 67, 54, 0.3);
    transition: all var(--transition-speed) var(--transition-timing);
}

.smtp-status-badge.configured {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border-color: rgba(76, 175, 80, 0.3);
}

.smtp-toggle-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-shadow: none;
    transition: all var(--transition-speed) var(--transition-timing);
}

.smtp-toggle-btn:hover {
    background: rgba(0, 104, 55, 0.1);
    transform: none;
    box-shadow: none;
}

.smtp-settings-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 1.5rem;
}

.smtp-settings-body.open {
    max-height: 5000px;
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.smtp-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-left: 45px;
}

.password-toggle-btn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    opacity: 0.6;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-shadow: none;
    transition: opacity 0.3s ease;
}

.password-toggle-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-50%);
    box-shadow: none;
}

.smtp-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.smtp-test-result {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease;
}

.smtp-test-result.loading {
    background: rgba(51, 153, 255, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(51, 153, 255, 0.3);
}

.smtp-test-result.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.smtp-test-result.error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.smtp-info-box {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(0, 104, 55, 0.08);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    border: 1px solid rgba(0, 104, 55, 0.15);
}

.smtp-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.smtp-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.smtp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(0, 104, 55, 0.08), rgba(0, 166, 81, 0.05));
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
}

.smtp-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.smtp-card-user {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.7;
    margin-right: 0.5rem;
    direction: ltr;
    display: inline-block;
}

.smtp-card-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.smtp-card-actions button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    padding: 0;
    min-width: unset;
}

.smtp-test-single-btn {
    background: rgba(51, 153, 255, 0.1);
    color: var(--accent-color);
}

.smtp-test-single-btn:hover {
    background: rgba(51, 153, 255, 0.2);
    transform: none;
    box-shadow: none;
}

.smtp-collapse-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-light);
}

.smtp-collapse-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: none;
    box-shadow: none;
}

.smtp-remove-btn {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
}

.smtp-remove-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    transform: none;
    box-shadow: none;
}

.smtp-card-body {
    padding: 1rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.smtp-card-body.collapsed {
    max-height: 0;
    padding: 0 1rem;
    overflow: hidden;
}

.smtp-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
    opacity: 0.6;
    font-size: 0.95rem;
}

.smtp-empty-state i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.add-smtp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    border: 2px dashed var(--primary-color);
    background: rgba(0, 104, 55, 0.04);
    color: var(--primary-color);
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.add-smtp-btn:hover {
    background: rgba(0, 104, 55, 0.1);
    border-color: var(--primary-light);
    transform: none;
    box-shadow: none;
}

.smtp-global-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.email-system-container {
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: center;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-light);
}

input, textarea, select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 0.5rem;
    background: var(--background-light);
    color: var(--text-light);
    font-family: 'Cairo', sans-serif;
    transition: all var(--transition-speed) var(--transition-timing);
    font-size: 1rem;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 104, 55, 0.2);
}

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

#emails {
    direction: ltr;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
}

.message-content-text {
    direction: auto;
    text-align: start;
    transition: direction 0.3s ease;
}

.message-subject {
    direction: auto;
    text-align: start;
    transition: direction 0.3s ease;
}

.rtl-text {
    direction: rtl;
    text-align: right;
    font-size: 1rem;
}

.ltr-text {
    direction: ltr;
    text-align: left;
    font-size: 1rem;
}

button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) var(--transition-timing);
    font-size: 0.95rem;
    white-space: nowrap;
    margin: 0.3rem;
    box-shadow: var(--shadow-light);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

button:active {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.action-buttons, .templates-buttons, .main-action-buttons, .export-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.copy-btn {
    background: linear-gradient(135deg, var(--accent-color), #4da6ff);
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #4da6ff, var(--accent-color));
}

.save-btn {
    background: linear-gradient(135deg, var(--success-color), #66bb6a);
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
}

.save-btn:hover {
    background: linear-gradient(135deg, #66bb6a, var(--success-color));
}

.message-search-container {
    background: var(--glass-bg);
    border-radius: 0.8rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
}

.search-header {
    margin-bottom: 1rem;
}

.search-header h3 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.search-input-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.8rem 3rem 0.8rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 0.5rem;
    background: var(--background-light);
    color: var(--text-light);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: all var(--transition-speed) var(--transition-timing);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 104, 55, 0.2);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    margin: 0;
    padding: 0;
}

.clear-search-btn:hover {
    background: #d32f2f;
    transform: translateY(-50%) scale(1.1);
}

.search-results-info {
    background: rgba(0, 104, 55, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

.message-container {
    background: var(--glass-bg);
    border-radius: 0.8rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-light);
    box-shadow: var(--shadow-light);
    transition: all var(--transition-speed) var(--transition-timing);
    position: relative;
}

.message-container.active {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-medium);
    transform: translateY(-3px);
}

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

.message-container.message-1 { border-color: var(--message-1); }
.message-container.message-2 { border-color: var(--message-2); }
.message-container.message-3 { border-color: var(--message-3); }
.message-container.message-4 { border-color: var(--message-4); }
.message-container.message-5 { border-color: var(--message-5); }

.message-selection {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(0, 104, 55, 0.1);
    border-radius: 0.5rem;
    border: 1px solid var(--primary-color);
}

.message-selection input[type="checkbox"] {
    width: auto;
    margin-left: 0.5rem;
    transform: scale(1.2);
    cursor: pointer;
}

.message-selection label {
    margin: 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    flex: 1;
}

.message-title-display {
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.8;
    margin-right: 0.5rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
}

.message-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.message-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 8px;
}

.message-1 .message-indicator { background-color: var(--message-1); }
.message-2 .message-indicator { background-color: var(--message-2); }
.message-3 .message-indicator { background-color: var(--message-3); }
.message-4 .message-indicator { background-color: var(--message-4); }
.message-5 .message-indicator { background-color: var(--message-5); }

.message-actions {
    display: flex;
    gap: 0.5rem;
}

.message-collapse-btn, .remove-message {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.message-collapse-btn {
    color: var(--text-light);
}

.message-collapse-btn:hover {
    background-color: rgba(0, 104, 55, 0.1);
    transform: rotate(180deg);
}

.remove-message {
    color: var(--error-color);
}

.remove-message:hover {
    background-color: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.message-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.message-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.html-toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.8rem 1rem;
    background: rgba(0, 104, 55, 0.06);
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
}

.html-toggle-label {
    font-weight: 600;
    margin: 0;
    color: var(--text-light);
}

.html-toggle-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.html-option-label {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.5;
    transition: all 0.3s ease;
    cursor: default;
}

.html-option-label.active {
    opacity: 1;
    color: var(--primary-color);
}

.html-toggle-switch {
    margin: 0;
}

.message-html-content {
    direction: ltr;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    min-height: 200px;
    background: var(--background-light);
    border: 2px solid var(--border-light);
    border-radius: 0.5rem;
    padding: 0.8rem 1rem;
    color: var(--text-light);
    tab-size: 4;
    line-height: 1.6;
    resize: vertical;
    width: 100%;
    transition: all var(--transition-speed) var(--transition-timing);
}

.message-html-content:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 104, 55, 0.2);
}

.html-preview-container {
    margin-top: 1rem;
    border-radius: 0.8rem;
    overflow: hidden;
    border: 2px solid var(--border-light);
    background: #fff;
}

.html-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.html-preview-header label {
    color: white;
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.preview-refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 0.4rem;
    margin: 0;
    box-shadow: none;
}

.preview-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: none;
    box-shadow: none;
}

.html-preview-frame {
    min-height: 200px;
    max-height: 500px;
    overflow: auto;
    background: #ffffff;
}

.html-preview-iframe {
    width: 100%;
    min-height: 200px;
    border: none;
    display: block;
}

[data-theme="dark"] .html-preview-container {
    border-color: var(--border-dark);
}

[data-theme="dark"] .html-preview-frame {
    background: #ffffff;
}

.html-mode-group {
    animation: fadeIn 0.3s ease;
}

.add-message-btn {
    width: 100%;
    padding: 1rem;
    margin: 1rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    font-size: 1.1rem;
}

.add-message-btn:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

.message-selection-controls {
    background: var(--glass-bg);
    border-radius: 0.8rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
}

.selection-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.toggle-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: 0.8rem;
    border: 1px solid var(--glass-border);
}

.toggle-label {
    font-weight: 600;
    margin: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-light);
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

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

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.toggle-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    gap: 1rem;
}

.toggle-labels span {
    opacity: 0.6;
    transition: 0.3s;
}

.toggle-labels span.active {
    opacity: 1;
    font-weight: 600;
    color: var(--primary-color);
}

.templates-container {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 0.8rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.templates-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.8rem;
}

.templates-header h3 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.templates-select {
    margin-bottom: 1rem;
}

.history-log {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 0.8rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    max-height: 300px;
    overflow-y: auto;
}

.history-log h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-item {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background: rgba(0, 104, 55, 0.05);
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover {
    background: rgba(0, 104, 55, 0.1);
}

.history-actions {
    display: flex;
    gap: 0.3rem;
}

.undo-history-btn {
    background: var(--warning-color);
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    margin: 0;
}

.undo-history-btn:hover {
    background: #ffad33;
}

.export-section {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 0.8rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.export-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ready-emails-section {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 0.8rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.ready-emails-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: column;
}

.email-count-input {
    max-width: 200px;
    margin-bottom: 1rem;
}

.email-batches {
    margin-top: 1.5rem;
}

.email-batch {
    background: rgba(0, 164, 81, 0.05);
    border: 1px solid var(--secondary-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.batch-title {
    font-weight: 600;
    color: var(--secondary-color);
}

.batch-actions {
    display: flex;
    gap: 0.5rem;
}

.email-list {
    background: var(--background-light);
    border-radius: 0.3rem;
    padding: 0.8rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 100px;
    overflow-y: auto;
}

.toast {
    position: fixed;
    top: calc(var(--header-height) + 20px);
    right: 20px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-medium);
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: linear-gradient(135deg, var(--error-color), #e57373);
}

.toast.success {
    background: linear-gradient(135deg, var(--success-color), #81c784);
}

.notification {
    position: fixed;
    top: calc(var(--header-height) + 20px);
    left: 20px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-medium);
    transform: translateX(-120%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification.show {
    transform: translateX(0);
}

.auto-save-indicator {
    position: fixed;
    bottom: 70px;
    right: 20px;
    padding: 0.5rem 1rem;
    background: rgba(0, 104, 55, 0.2);
    color: var(--primary-color);
    border-radius: 1rem;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.auto-save-indicator.show {
    opacity: 1;
}

.status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.8rem;
    background: rgba(0, 104, 55, 0.1);
    color: var(--primary-color);
    text-align: center;
    font-weight: 600;
    display: none;
}

.status.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.sending-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sending-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.sending-modal {
    background: var(--background-light);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-dark);
    max-width: 400px;
    width: 90%;
}

.sending-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.sending-modal h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.sending-modal p {
    color: var(--text-light);
    opacity: 0.8;
}

.floating-buttons {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 90;
}

.float-button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-speed) var(--transition-timing);
    border: none;
}

.float-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

footer {
    background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
    color: white;
    padding: 1rem;
    text-align: center;
    margin-top: auto;
    font-size: 0.9rem;
}

.queue-settings-inline {
    background: var(--glass-bg);
    border-radius: 0.8rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.antispam-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.antispam-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.antispam-header:hover {
    background: rgba(255,255,255,0.05);
}

.antispam-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.antispam-header h3 i {
    color: #4caf50;
}

.antispam-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.3s;
}

.antispam-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.antispam-body.open {
    max-height: 2000px;
    padding: 0 1.5rem 1.5rem;
}

.antispam-info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem 1rem;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 0.6rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.antispam-info-box i {
    color: #4caf50;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.antispam-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 0.7rem;
    margin-bottom: 0.7rem;
    transition: border-color 0.3s;
}

.antispam-option:hover {
    border-color: rgba(76, 175, 80, 0.4);
}

.antispam-option-info {
    flex: 1;
}

.antispam-option-info strong {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.antispam-option-info strong i {
    color: #4caf50;
    font-size: 0.85rem;
}

.antispam-option-info p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.antispam-example {
    margin-top: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: rgba(0,0,0,0.2);
    border-radius: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.8;
    direction: ltr;
    text-align: left;
}

.antispam-example code {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
}

.antispam-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.antispam-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.antispam-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(255, 3, 3);
    border-radius: 24px;
    transition: 0.3s;
}

.antispam-toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.antispam-toggle input:checked + .antispam-toggle-slider {
    background: #4caf50;
}

.antispam-toggle input:checked + .antispam-toggle-slider:before {
    transform: translateX(20px);
}

.antispam-greeting-config,
.antispam-unsub-config {
    margin-top: 0.6rem;
    padding: 0.6rem;
    background: rgba(0,0,0,0.15);
    border-radius: 0.5rem;
}

.antispam-greeting-config label,
.antispam-unsub-config label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.antispam-greeting-config input,
.antispam-unsub-config input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    border-radius: 0.4rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.antispam-greeting-config input:focus,
.antispam-unsub-config input:focus {
    border-color: #4caf50;
    outline: none;
}

.queue-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid #0d7377;
    box-shadow: var(--shadow-light);
    animation: fadeIn 0.4s ease;
}

.queue-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-light);
}

.queue-panel-header h3 {
    color: #0d7377;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.15rem;
}

.queue-close-btn {
    background: none;
    border: none;
    color: var(--text-light);
    opacity: 0.6;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-shadow: none;
    transition: all 0.3s ease;
}

.queue-close-btn:hover {
    opacity: 1;
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    transform: none;
    box-shadow: none;
}

.queue-status-container {
    margin-bottom: 1rem;
}

.queue-status-text {
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    font-size: 0.95rem;
    background: rgba(0, 104, 55, 0.08);
    color: var(--text-light);
    transition: all 0.3s ease;
}

.queue-status-loading {
    background: rgba(51, 153, 255, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(51, 153, 255, 0.3);
}

.queue-status-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.queue-status-error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.queue-status-warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.queue-progress-container {
    margin-bottom: 1rem;
}

.queue-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
}

.queue-progress-bar {
    width: 100%;
    height: 16px;
    background: var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.queue-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d7377, #14a3a8, #17c4ca);
    transition: width 0.6s ease;
    border-radius: 8px;
    position: relative;
}

.queue-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: progressShine 2s linear infinite;
}

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

.queue-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.queue-error-log {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 0.5rem;
    background: rgba(244, 67, 54, 0.05);
    border: 1px solid rgba(244, 67, 54, 0.2);
    max-height: 150px;
    overflow-y: auto;
}

.queue-error-item {
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--error-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.queue-error-item:last-child {
    margin-bottom: 0;
}

.queue-send-btn {
    position: relative;
    overflow: hidden;
}

.queue-send-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.queue-send-btn:hover::before {
    opacity: 1;
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .header-title {
        font-size: 1rem;
    }

    .container {
        padding: 0.75rem;
    }

    .smtp-fields-grid,
    .supabase-fields-grid {
        grid-template-columns: 1fr;
    }

    .smtp-settings-header,
    .supabase-settings-header {
        padding: 0.8rem 1rem;
    }

    .smtp-settings-header h3,
    .supabase-settings-header h3 {
        font-size: 0.95rem;
    }

    .smtp-status-badge,
    .supabase-status-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    .email-system-container {
        padding: 1.5rem 1rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .side-menu {
        width: 85%;
        max-width: 300px;
    }

    .toggle-switch-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .toggle-switch {
        align-self: flex-end;
    }

    .action-buttons,
    .templates-buttons,
    .main-action-buttons,
    .export-buttons,
    .selection-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        margin: 1rem 0;
        flex-direction: row;
    }
}

    button {
        flex: 0 0 auto;
        font-size: 0.8rem;
        padding: 0.6rem 0.9rem;
        min-height: 40px;
        border-radius: 0.4rem;
    }

    .batch-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
        justify-content: center;
    }

    .batch-actions button {
        flex: 1;
        min-width: auto;
    }

    .email-list {
        font-size: 0.8rem;
    }

    .search-input {
        font-size: 0.9rem;
    }

    .message-search-container {
        padding: 1rem;
    }

    .message-selection {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .message-selection input[type="checkbox"] {
        margin-left: 0;
        align-self: flex-start;
    }

    .message-container {
        padding: 1.2rem;
        margin-bottom: 1rem;
    }

    .message-selection label {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .message-title-display {
        font-size: 0.8rem;
        display: block;
        margin-top: 0.3rem;
    }

    .html-toggle-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .html-toggle-options {
        align-self: flex-end;
    }

    .message-html-content {
        min-height: 150px;
        font-size: 0.8rem;
    }

    .html-preview-frame {
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    .email-system-container {
        padding: 1rem 0.75rem;
    }

    .stats {
        gap: 0.8rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .message-container {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .floating-buttons {
        right: 0.5rem;
        bottom: 0.75rem;
    }

    .float-button {
        width: 40px;
        height: 40px;
    }

    .auto-save-indicator {
        bottom: 60px;
        right: 10px;
        font-size: 0.8rem;
    }

    .search-input {
        font-size: 0.85rem;
        padding: 0.7rem 2.5rem 0.7rem 0.8rem;
    }

    .clear-search-btn {
        width: 25px;
        height: 25px;
        right: 8px;
        font-size: 0.7rem;
    }

    .message-search-container {
        padding: 0.8rem;
    }

    button {
        font-size: 0.75rem;
        padding: 0.5rem 0.7rem;
        min-height: 38px;
    }

    .action-buttons,
    .templates-buttons,
    .main-action-buttons,
    .export-buttons,
    .selection-buttons {
        gap: 0.3rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .templates-container,
    .history-log,
    .export-section,
    .ready-emails-section {
        padding: 1rem;
        margin-top: 1.5rem;
    }

    .templates-select select {
        font-size: 0.9rem;
        padding: 0.7rem;
    }

    .batch-title {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 1.2rem;
        text-align: center;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 0.5rem;
    }

    .email-system-container {
        padding: 0.8rem 0.5rem;
    }

    button {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        min-height: 36px;
    }

    .header-title {
        font-size: 0.9rem;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .stat-card {
        padding: 0.8rem;
    }

    .stat-card h3 {
        font-size: 1rem;
    }

    .stat-card p {
        font-size: 1.3rem;
    }
}
