/* public/css/style.css */

/* --- 1. CSS Variables (Themes) --- */
/* Default Dark Theme */
:root {
    /* Background Colors */
    --bg-primary: #09090B;
    /* Main dark background */
    --bg-secondary: #18181B;
    /* Lighter background for cards/tables */
    --bg-sidebar: #18181B;
    /* Sidebar background */
    --bg-tertiary: #27272A;
    /* Tertiary background */

    /* Text Colors */
    --text-primary: #FAFAFA;
    /* Light main text */
    --text-secondary: #A1A1AA;
    /* Muted/secondary text */
    --text-tertiary: #71717A;
    /* Even more muted text */

    /* Border Colors */
    --border-color: #27272A;
    /* Borders and dividers */
    --border-light: #3F3F46;
    /* Lighter borders */

    /* Accent Colors */
    --accent-primary: #BF66FF;
    /* The main purple color */
    --accent-primary-light: #D8B4FE;
    /* Lighter purple */
    --accent-primary-dark: #9333EA;
    /* Darker purple */
    --accent-danger: #F74646;
    /* Red for delete/close buttons */
    --accent-success: #28A745;
    /* Green for "Active" status */
    --accent-warning: #F59E0B;
    /* Orange for warnings */
    --accent-info: #3B82F6;
    /* Blue for info */

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #BF66FF 0%, #9333EA 100%);
    --gradient-danger: linear-gradient(135deg, #F74646 0%, #DC2626 100%);
    --gradient-success: linear-gradient(135deg, #28A745 0%, #16A34A 100%);

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Glow Effects */
    --glow-primary: 0 0 20px rgba(191, 102, 255, 0.3);
    --glow-danger: 0 0 20px rgba(247, 70, 70, 0.3);
    --glow-success: 0 0 20px rgba(40, 167, 69, 0.3);

    /* Glassmorphism */
    --glass-bg: rgba(24, 24, 27, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #F4F6F8;
    --bg-secondary: #FFFFFF;
    --bg-sidebar: #E9EEF3;
    --bg-tertiary: #E5E7EB;
    --text-primary: #1E1E2D;
    --text-secondary: #5A5A72;
    --text-tertiary: #9CA3AF;
    --border-color: #D1D9E6;
    --border-light: #E5E7EB;

    /* Adjust shadows for light mode */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
}

/* --- 2. Global Resets & Body --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    /* This enables the two-column layout */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-light);
}

/* Typography Hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5,
h6 {
    font-size: 1rem;
}

/* --- 3. Main Layout Structure --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 20px;
    min-height: 100vh;
}

/* --- 4. Sidebar Styling --- */
.sidebar .logo {
    margin-bottom: 40px;
    padding: 0;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.sidebar .logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    width: 100%;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}


.sidebar .logo img {
    height: 40px;
    filter: drop-shadow(0 0 10px rgba(191, 102, 255, 0.3));
}

.sidebar .logo span {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: -0.02em;
    text-shadow: 0 0 20px rgba(191, 102, 255, 0.2);
    white-space: nowrap;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 12px 16px;
    font-size: 15px;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius-md);
    background: transparent;
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform var(--transition-base);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar .nav-link svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.sidebar .nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(191, 102, 255, 0.08);
    transform: translateX(2px);
}

.sidebar .nav-link:hover svg {
    transform: scale(1.1);
}

.sidebar .nav-link.active {
    color: var(--accent-primary);
    font-weight: 600;
    background-color: rgba(191, 102, 255, 0.12);
}

.sidebar .nav-link.active::before {
    transform: scaleY(1);
}

.sidebar .nav-link.active svg {
    filter: drop-shadow(0 0 4px rgba(191, 102, 255, 0.4));
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-bottom .btn-close-account {
    width: 100%;
    padding: 12px;
    background: var(--gradient-danger);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(247, 70, 70, 0.2);
}

.sidebar-bottom .btn-close-account:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(247, 70, 70, 0.3);
}

.sidebar-bottom .btn-close-account:active {
    transform: translateY(0);
}

.sidebar-bottom .logout-link {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.sidebar-bottom .logout-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-bottom .btn-close-account svg,
.sidebar-bottom .logout-link svg {
    width: 18px;
    height: 18px;
}

/* --- 5. Main Content Header Styling --- */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.content-header .header-title h2 {
    font-size: 28px;
    font-weight: 600;
}

.content-header .header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-secondary);
}

.header-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin-bottom: 20px;
}

/* --- 6. Generic Component Styles (Buttons, Cards) --- */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #FFFFFF;
    box-shadow: 0 4px 14px 0 rgba(191, 102, 255, 0.39);
}

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

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

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

.btn-secondary:hover:not(:disabled) {
    background-color: var(--border-light);
    border-color: var(--border-light);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(247, 70, 70, 0.39);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(247, 70, 70, 0.5);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(40, 167, 69, 0.39);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(40, 167, 69, 0.5);
}

/* Button Loading State */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-loading-spinner 0.6s linear infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }

    to {
        transform: rotate(1turn);
    }
}

/* Card Styles */
.content-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.content-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.content-card h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* --- 7. Page-Specific Styles (Campaigns) --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title-with-icon {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-icon {
    font-size: 24px;
}

.page-title-with-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-secondary);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
}

.page-description {
    color: var(--text-secondary);
    margin-top: 5px;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 50px 0;
}

.empty-state h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* public/css/style.css */
/* Add this to the end of your file */

/* --- 8. Form & Input Styles --- */
.form-group {
    margin-bottom: 24px;
}

.form-group-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.flex-grow {
    flex-grow: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-base);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(191, 102, 255, 0.1), var(--glow-primary);
    background-color: var(--bg-secondary);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
    opacity: 0.7;
}

/* Error State */
input.error,
textarea.error,
select.error {
    border-color: var(--accent-danger);
}

input.error:focus,
textarea.error:focus,
select.error:focus {
    box-shadow: 0 0 0 3px rgba(247, 70, 70, 0.1), var(--glow-danger);
}

/* Success State */
input.success,
textarea.success,
select.success {
    border-color: var(--accent-success);
}

input.success:focus,
textarea.success:focus,
select.success:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1), var(--glow-success);
}

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

.input-description {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.input-with-icon {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-button,
.action-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.danger-icon {
    color: var(--accent-danger);
}

.icon-button:hover,
.action-icon:hover {
    color: var(--accent-primary);
    background-color: rgba(191, 102, 255, 0.1);
    transform: scale(1.1);
}


/* Override for danger icons */
.danger-icon:hover {
    color: var(--accent-danger);
    background-color: rgba(247, 70, 70, 0.1);
}


.editor-toolbar {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

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

.btn-danger {
    background-color: var(--accent-danger);
    color: #FFFFFF;
}

.btn-warning {
    background-color: #FFC107;
    color: #1E1E2D;
}

.btn-success {
    background-color: var(--accent-success);
    color: #FFFFFF;
}

/* public/css/style.css */
/* Add this to the end of your file */

/* --- 9. Page-Specific Styles (Contacts) --- */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    /* Left column is smaller */
    gap: 20px;
    align-items: start;
}

.input-description {
    font-size: 13px;
    color: var(--text-secondary);
}

/* public/css/style.css */
/* Add this to the end of your file, or replace the old table styles */

/* --- 9. Page-Specific Styles (Contacts) --- */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    align-items: start;
}

.input-description {
    font-size: 13px;
    color: var(--text-secondary);
}


.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table thead th {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    background-color: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-light);
}

/* Zebra striping for better readability */
.data-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.01);
}

.data-table tbody tr {
    transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: rgba(191, 102, 255, 0.05);
    transform: scale(1.001);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .actions {
    text-align: right;
    white-space: nowrap;
    width: 120px;
}

.data-table .action-icon {
    margin-left: 8px;
    font-size: 18px;
    opacity: 0.6;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.data-table .action-icon:hover {
    opacity: 1;
    background-color: rgba(191, 102, 255, 0.1);
    transform: scale(1.15);
}

.data-table .action-icon.danger-icon:hover {
    background-color: rgba(247, 70, 70, 0.1);
}

/* Table links */
.data-table-link {
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.data-table-link:hover {
    color: var(--accent-primary);
}

/* public/css/style.css */
/* Add this to the end of your file */

/* --- 10. Page-Specific Styles (Unsubscribed) --- */
.content-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.inline-form input {
    flex-grow: 1;
    /* Allows the input to take up available space */
}

.divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 30px 0;
}

.empty-state-compact {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 6px;
}

/* Reusable Info Box Style */
.info-box {
    margin-top: 25px;
    padding: 15px;
    background-color: rgba(255, 193, 7, 0.1);
    /* Yellow with transparency */
    border-left: 4px solid #FFC107;
    /* Solid yellow border */
    border-radius: 4px;
}

.info-box p {
    color: #FFD54F;
    /* Light yellow text */
    font-size: 14px;
}

.info-box p strong {
    color: #FFC107;
    /* Brighter yellow for the "Note:" */
}

/* public/css/style.css */
/* Add this to the end of your file */

/* --- 11. Page-Specific Styles (Tracking) --- */
.setting-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.setting-section.full-width {
    flex-direction: column;
}

.setting-text {
    flex: 2;
    /* Takes up 2/3 of the space */
}

.setting-action {
    flex: 1;
    /* Takes up 1/3 of the space */
    min-width: 250px;
}

/* -- Toggle Switch Styles -- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

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

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

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

input:checked+.slider:before {
    transform: translateX(22px);
}

/* -- Status Badge Styles -- */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    margin-top: 8px;
}

.status-badge.verified {
    background-color: rgba(40, 167, 69, 0.2);
    color: #58dd7a;
}

/* -- Config Info Box -- */
.config-box {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--accent-primary);
    margin-top: 15px;
}

.config-box h4 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.config-box p {
    color: var(--text-secondary);
}

.config-box code {
    display: block;
    margin-top: 10px;
    padding: 10px;
    background-color: var(--bg-primary);
    border-radius: 4px;
    font-family: monospace;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

/* -- Tab Styles -- */
.tab-container {
    margin-top: 15px;
    margin-bottom: 20px;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-link {
    padding: 10px 20px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    /* Overlaps the container border */
}

.tab-link.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    padding: 20px 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.item-list-detailed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.item-list-detailed>li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.item-info {
    margin: auto 0;
}

.item-info .item-title {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
}

.item-info .item-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* New "Default" badge style */
.status-badge.default {
    background-color: rgba(123, 104, 238, 0.2);
    color: #a99eff;
}

/* Sender connection failed badge */
.status-badge.sender-failed {
    background-color: rgba(220, 53, 69, 0.2);
    color: #ff6b7a;
    cursor: help;
}

/* public/css/style.css */
/* Add this to the end of your file */

/* --- 13. Page-Specific Styles (Account Settings) --- */

.danger-zone {
    background-color: rgba(247, 70, 70, 0.1);
    border: 1px solid var(--accent-danger);
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
}

.danger-zone label {
    color: var(--text-primary);
    font-weight: 500;
}

.danger-zone input {
    margin-top: 8px;
    border-color: var(--accent-danger);
}

/* Make code snippets inside tables and info boxes look good */
code {
    background-color: var(--bg-primary);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--text-secondary);
}

/* --- 14. Notification Styles --- */
.notification {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-left: 20px;
    margin-bottom: 20px;
}

.notification.success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #FFFFFF;
}

.notification.error {
    background-color: rgba(247, 70, 70, 0.2);
    color: #FFFFFF;
}

/* --- 15. Theme Switcher --- */
.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

/* --- 16. Header Theme Toggle --- */
.theme-toggle-button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px;
}

.theme-toggle-button svg {
    width: 20px;
    height: 20px;
}

/* Hide sun icon by default (in dark mode) */
#sun-icon {
    display: none;
}

/* Hide moon icon in light mode */
[data-theme="light"] #moon-icon {
    display: none;
}

[data-theme="light"] #sun-icon {
    display: block;
}

/* --- 17. Modal Styles --- */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.6);
    /* Black w/ opacity */
    padding-top: 60px;
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

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

.modal-header h2 {
    font-size: 20px;
}

.modal-close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

/* --- 18. Toast Notification Styles --- */
.notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 1001;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
    animation: fade-in-out 3s forwards;
    max-width: 350px;
}

.notification-toast.success {
    background-color: var(--accent-success);
    border-color: #28a745;
    color: white;
}

.notification-toast.error {
    background-color: var(--accent-danger);
    border-color: #dc3545;
    color: white;
}

.notification-toast.info {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

@keyframes fade-in-out {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    90% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* --- 19. Minimal Form Group --- */
.minimal-form-group {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    /* large-radii card */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* subtle, soft shadow */
    padding: 24px;
    border: 1px solid var(--border-color);
    margin-top: 30px;
}

#notification-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.notification {
    padding: 10px 20px;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: fadeInOut 3s forwards;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    90% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.minimal-form-group label {
    font-weight: 700;
    /* bold */
    color: var(--text-primary);
    /* dark gray */
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.minimal-form-group .input-description {
    color: var(--text-secondary);
    /* lighter, standard gray */
    font-size: 14px;
    margin-top: 12px;
}

.minimal-form-group input[type="number"] {
    width: 100%;
    border-radius: 8px;
    /* small-to-medium rounded corners */
    background-color: var(--bg-primary);
    /* very light gray background */
    border: 1px solid var(--border-color);
    /* thin, low-contrast border */
    padding: 16px;
    /* generous internal padding */
    font-size: 16px;
    color: var(--text-primary);
}

/* ========================================
   UTILITY CLASSES & ANIMATIONS
   ======================================== */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Page Transition Staging */
.page-transition-exit {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.page-transition-enter {
    opacity: 0;
}

.page-transition-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

/* Paint Holding State */
.page-loading {
    opacity: 0.6;
    transform: scale(0.995);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    /* Prevent clicks while loading */
}

/* Slide In Animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Loading Skeleton */
/* GPU-accelerated shimmer animation for better performance */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--bg-tertiary) 50%,
            transparent 100%);
    animation: shimmer 1.5s infinite;
    will-change: transform;
}

/* Optimized skeleton loader class */
.skeleton-loader {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.skeleton-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.05) 50%,
            transparent 100%);
    animation: shimmer 1.5s infinite;
    will-change: transform;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.text-small {
    font-size: 0.875rem;
}

.mt-1 {
    margin-top: var(--space-sm);
}

.mt-2 {
    margin-top: var(--space-md);
}

.mt-3 {
    margin-top: var(--space-lg);
}

.mt-4 {
    margin-top: var(--space-xl);
}

.mb-1 {
    margin-bottom: var(--space-sm);
}

.mb-2 {
    margin-bottom: var(--space-md);
}

.mb-3 {
    margin-bottom: var(--space-lg);
}

.mb-4 {
    margin-bottom: var(--space-xl);
}

.p-1 {
    padding: var(--space-sm);
}

.p-2 {
    padding: var(--space-md);
}

.p-3 {
    padding: var(--space-lg);
}

.p-4 {
    padding: var(--space-xl);
}

/* Badge Component */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: rgba(191, 102, 255, 0.15);
    color: var(--accent-primary);
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--accent-success);
}

.badge-danger {
    background-color: rgba(247, 70, 70, 0.15);
    color: var(--accent-danger);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Divider */
.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: var(--space-lg) 0;
}

/* Card Variants */
.card-hover {
    transition: all var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* --- 10. Template Grid Layout (Moved from templates/index.php) --- */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Ensure display grid is forced if JS toggles visibility */
.templates-grid[style*="display: grid"] {
    display: grid !important;
}

.template-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: var(--accent-primary);
}

.template-card-header {
    margin-bottom: 10px;
}

.template-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.template-card-body {
    flex-grow: 1;
    margin-bottom: 20px;
}

.template-subject {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

/* --- 11. Generic Components (Moved from templates/index.php) --- */

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-icon svg {
    stroke: currentColor;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--accent-danger);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
}

/* --- 12. Modal Styles --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: none;
    /* Changed from flex to match JS toggle logic */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-container {
    background: var(--bg-secondary);
    width: 90%;
    max-width: 800px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease;
    animation: modalPop 0.3s ease-out forwards;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

@keyframes modalPop {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn,
.modal-close-btn-test,
.modal-close-btn-delete {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Delete Modal Specifics */
#delete-modal .modal-container {
    padding: 40px 30px;
    max-width: 400px;
    text-align: center;
}

#delete-modal .modal-footer {
    justify-content: center;
    border-top: none;
    padding-top: 0;
}

#delete-modal .modal-icon-danger {
    width: 72px;
    height: 72px;
    background: rgba(220, 53, 69, 0.1);
    color: var(--accent-danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: pulseRed 2s infinite;
}

.modal-icon-danger svg {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

@keyframes pulseRed {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Button Refinements */
.btn-delete {
    background: var(--accent-danger);
    color: white;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(220, 53, 69, 0.35);
    filter: brightness(1.05);
}

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

.btn-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Send Test Button */
#send-test-trigger-btn {
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    transition: all 0.3s ease;
}

#send-test-trigger-btn:hover:not(:disabled) {
    background: rgba(191, 102, 255, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(191, 102, 255, 0.2);
}

#send-test-trigger-btn:hover:not(:disabled) svg {
    transform: translate(3px, -3px) scale(1.1);
}

#send-test-trigger-btn svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#send-test-trigger-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-tertiary);
}

#send-test-modal .modal-container {
    border-top: 4px solid var(--accent-primary);
}

/* Tools */
.editor-toolbar {
    padding: 8px 0;
    margin-bottom: 10px;
}

.dropdown-menu {
    top: 100%;
    left: 0;
    margin-top: 5px;
    display: none;
}

/* Notifications */
.notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    font-weight: 500;
    animation: slideUp 0.3s ease;
}

.notification-toast.success {
    border-left: 4px solid var(--accent-success);
}

.notification-toast.error {
    border-left: 4px solid var(--accent-danger);
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* --- Loading Bar (NProgress Style) --- */
#nprogress {
    pointer-events: none;
    position: fixed;
    z-index: 1031;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
}

#nprogress .bar {
    background: var(--accent-primary);
    position: absolute;
    z-index: 1031;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translate3d(-100%, 0, 0);
    transition: transform 200ms ease;
}

/* Fancy blur effect */
#nprogress .peg {
    display: block;
    position: absolute;
    right: 0px;
    width: 100px;
    height: 100%;
    box-shadow: 0 0 10px var(--accent-primary), 0 0 5px var(--accent-primary);
    opacity: 1.0;
    transform: rotate(3deg) translate(0px, -4px);
}

/* --- Admin Panel & Impersonation --- */
.sidebar .nav-link.admin-link {
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.06);
    margin-bottom: 8px;
}

.sidebar .nav-link.admin-link:hover {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-warning);
}

.sidebar .nav-link.admin-link.active {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}

.sidebar .nav-link.admin-link.active::before {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(245, 158, 11, 0.3); }
    50% { border-color: rgba(245, 158, 11, 0.6); }
}

.impersonation-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--accent-warning);
    min-width: 0;
    overflow: hidden;
}

.impersonation-info strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-exit-impersonation {
    flex-shrink: 0;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent-warning);
    border: none;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-exit-impersonation:hover {
    background: #D97706;
    color: #fff;
    transform: translateY(-1px);
}