/* ===========================
   ROOTLOGIC Mailer - Styles
   =========================== */

:root {
    --primary:       #1a237e;
    --primary-light: #3949ab;
    --accent:        #00bcd4;
    --success:       #2e7d32;
    --danger:        #c62828;
    --card-bg:       #ffffff;
    --text-muted:    #6c757d;
    --border:        #dee2e6;
    --shadow:        0 6px 32px rgba(0, 0, 0, 0.22);
    --radius:        10px;
}

/* ── Body ─────────────────────────────────────── */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    min-height: 100vh;
}

/* ── ROOTLOGIC Brand Header ───────────────────── */
.rootlogic-brand {
    text-align: center;
    padding: 28px 0 8px;
}

.rootlogic-brand h1 {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
    margin: 0;
}

.rootlogic-brand h1 span {
    color: var(--accent);
}

.rootlogic-brand p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 4px 0 0;
}

/* ── Card ─────────────────────────────────────── */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 22px 28px;
    border-bottom: none;
}

.card-header h1,
.card-header h3 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 1px;
}

.card-header .lead {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
    margin: 4px 0 0;
}

.card-body {
    background: #fafbfc;
    padding: 28px 32px;
}

/* ── Labels ───────────────────────────────────── */
label {
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 5px;
    color: #2c3e50;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: block;
}

/* ── Form Inputs ──────────────────────────────── */
.form-control {
    border-radius: 6px;
    border: 1.5px solid var(--border);
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
    color: #212529;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.13);
    outline: none;
    background: #ffffff;
}

/* ── Tabs ─────────────────────────────────────── */
.nav-tabs {
    border-bottom: 2px solid var(--border);
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 22px;
    border-radius: 0;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background: transparent;
}

.tab-content {
    border: 1.5px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0;
    background: #ffffff;
    overflow: hidden;
}

/* Raw text tab still needs padding */
#raw-text {
    padding: 16px;
}

/* ── Quill Editor Styling ─────────────────────── */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    background: #f4f5f7;
    border-radius: 0 !important;
    padding: 10px 12px;
}

.ql-container.ql-snow {
    border: none !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
}

.ql-editor {
    min-height: 220px;
    line-height: 1.75;
    color: #212529;
    padding: 16px 18px;
}

.ql-editor.ql-blank::before {
    color: #adb5bd;
    font-style: italic;
}

.ql-snow .ql-stroke {
    stroke: #555;
}

.ql-snow .ql-fill {
    fill: #555;
}

.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke {
    stroke: var(--primary);
}

.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--primary);
}

.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button.ql-active {
    color: var(--primary);
}

/* ── Buttons ──────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 7px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 13px 28px;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 10px rgba(26, 35, 126, 0.28);
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.91;
    box-shadow: 0 6px 20px rgba(26, 35, 126, 0.38);
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #9e9e9e 0%, #bdbdbd 100%);
    box-shadow: none;
    cursor: not-allowed;
}

.btn-sm.btn-primary {
    padding: 6px 16px;
    font-size: 0.8rem;
    border-radius: 5px;
}

/* ── Alerts ───────────────────────────────────── */
.alert {
    border-radius: 8px;
    border: none;
    font-size: 0.92rem;
    padding: 14px 18px;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success);
    border-left: 4px solid #4caf50;
}

.alert-danger {
    background: #ffebee;
    color: var(--danger);
    border-left: 4px solid #f44336;
}

.alert-secondary {
    background: #f1f3f5;
    color: #444;
    border-left: 4px solid #9e9e9e;
}

/* ── File Upload ──────────────────────────────── */
.custom-file-label {
    border-radius: 6px;
    border: 1.5px dashed #bdbdbd;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s;
    height: calc(1.5em + 0.75rem + 12px);
    line-height: 2.2;
}

.custom-file-label::after {
    background: var(--primary);
    color: white;
    border-radius: 0 6px 6px 0;
    font-weight: 600;
    height: 100%;
    line-height: 2.2;
}

.custom-file-input:focus ~ .custom-file-label {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.12);
}

/* ── Top Nav Bar ──────────────────────────────── */
.rl-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    margin: 20px 0 20px;
}

.rl-nav-brand {
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: #ffffff;
    text-decoration: none !important;
}

.rl-nav-brand span {
    color: var(--accent);
}

.rl-nav-brand:hover {
    opacity: 0.88;
}

.rl-nav-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none !important;
    margin-left: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.rl-nav-links a:hover,
.rl-nav-links a.active {
    color: var(--accent);
}

/* ── History Table ────────────────────────────── */
.history-table thead th {
    background: #f4f5f7;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding: 14px 16px;
    font-weight: 700;
}

.history-table tbody tr {
    transition: background 0.15s;
}

.history-table tbody tr:hover {
    background: #f0f4ff;
}

.history-table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: #f0f0f0;
    font-size: 0.88rem;
}

.history-date {
    color: #888;
    font-size: 0.82rem !important;
    white-space: nowrap;
}

.history-name {
    font-weight: 600;
    color: #2c3e50;
}

.history-to {
    color: #555;
    font-size: 0.85rem !important;
}

.history-subject {
    font-weight: 600;
    color: #1a237e;
}

.history-section-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
}

/* ── Footer Sticky ────────────────────────────── */
.rootlogic-footer {
    position: fixed;
    bottom: 0;
    left: 20px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.78rem;
    letter-spacing: 0.8px;
    padding-bottom: 8px;
}

/* ── Main Icon ────────────────────────────────── */
#email-icon {
    display: block;
    margin: auto;
    max-width: 72px;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.35));
}

/* ── Review Page - Table ──────────────────────── */
table td:first-child {
    font-weight: 700;
    width: 22%;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.6px;
    vertical-align: middle;
}

.table {
    border-radius: 8px;
    overflow: hidden;
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: #f0f0f0;
}

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

/* ── Message Preview ──────────────────────────── */
.message-preview {
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    min-height: 100px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #212529;
}

/* ── Pro Tip Text ─────────────────────────────── */
.pro-tip {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-top: 5px;
    margin-bottom: 0;
}

.pro-tip strong {
    color: var(--primary-light);
}

/* ── Section Divider ──────────────────────────── */
.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #bdbdbd; border-radius: 3px; }
