/* ============================================================
   ENGAGE by Velora — Email Marketing Platform
   Branding: Grupo Ana Rosa palette (burgundy/maroon)
   ============================================================ */

:root {
    --sidebar-bg: #3A0F18;
    --sidebar-hover: #4E1722;
    --sidebar-active: #6B1F2E;
    --accent: #7B2030;
    --accent-hover: #631A27;
    --accent-light: rgba(123, 32, 48, 0.12);
    --gold: #C9A96E;
    --gold-hover: #B8964F;
    --burgundy: #7B2030;
    --content-bg: #f5f6f8;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --sidebar-width: 250px;
}

/* ---- Global ---- */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--content-bg);
    min-height: 100vh;
}

a {
    text-decoration: none;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: #fff;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-logo-mark {
    width: 36px;
    height: 36px;
    background-color: var(--burgundy);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-mark span {
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    line-height: 1;
}

.sidebar-subtitle {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.65rem;
    display: block;
    margin-top: -2px;
}

.sidebar-brand .brand-icon {
    display: flex;
    align-items: center;
    gap: 3px;
}

.sidebar-brand .brand-icon .bar {
    display: inline-block;
    border-radius: 4px;
    transform-origin: bottom center;
}

.sidebar-brand .brand-icon .bar-1 {
    width: 6px;
    height: 22px;
    background-color: var(--accent);
    transform: rotate(15deg);
}

.sidebar-brand .brand-icon .bar-2 {
    width: 6px;
    height: 18px;
    background-color: var(--gold);
    transform: rotate(-5deg);
    margin-left: -2px;
}

.sidebar-brand .brand-icon .bar-3 {
    width: 6px;
    height: 24px;
    background-color: #1D4D66;
    transform: rotate(10deg);
    margin-left: -2px;
}

.sidebar-brand h5 {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.65);
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background-color: var(--sidebar-hover);
    border-left-color: var(--accent);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background-color: var(--sidebar-active);
    border-left-color: var(--accent);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0.5rem 1.25rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    padding: 0.25rem 1.5rem 0;
    margin-bottom: 0;
}

/* Sidebar footer branding */
.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.sidebar-footer .engage-badge {
    color: var(--gold);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ---- Page Footer ---- */
.page-footer {
    text-align: center;
    padding: 1rem 0 0.75rem;
}

.page-footer small {
    color: #bbb;
    font-size: 0.65rem;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.top-navbar .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.content-wrapper {
    padding: 1.5rem;
}

/* ---- Sidebar Toggle (mobile) ---- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    padding: 0;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

/* ---- Stat Cards ---- */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.85rem;
}

/* ---- Status Badges ---- */
.badge-draft {
    background-color: #6c757d;
    color: #fff;
}

.badge-sending {
    background-color: #0d6efd;
    color: #fff;
    animation: pulse-sending 1.5s ease-in-out infinite;
}

.badge-sent {
    background-color: var(--accent);
    color: #fff;
}

.badge-paused {
    background-color: var(--gold);
    color: #212529;
}

.badge-cancelled {
    background-color: #dc3545;
    color: #fff;
}

.badge-scheduled {
    background-color: #6f42c1;
    color: #fff;
}

.badge-active {
    background-color: var(--accent);
    color: #fff;
}

.badge-unsubscribed {
    background-color: #6c757d;
    color: #fff;
}

.badge-bounced {
    background-color: #dc3545;
    color: #fff;
}

@keyframes pulse-sending {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ---- Tables ---- */
.table-hover tbody tr {
    transition: background-color 0.15s ease;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #6c757d;
    border-bottom-width: 1px;
}

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

/* ---- Buttons ---- */
.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-accent:focus {
    box-shadow: 0 0 0 0.25rem rgba(123, 32, 48, 0.25);
}

.btn-gold {
    background-color: var(--gold);
    border-color: var(--gold);
    color: #fff;
}

.btn-gold:hover {
    background-color: var(--gold-hover);
    border-color: var(--gold-hover);
    color: #fff;
}

/* ---- Login Page ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4A1520 0%, #7B2030 40%, #5C1825 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
}

.login-card .card-body {
    padding: 2.5rem;
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand .client-logo {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.login-brand .client-logo .logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background-color: var(--burgundy);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}

.login-brand .client-logo .logo-mark span {
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1;
}

.login-brand .client-logo h4 {
    color: var(--burgundy);
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-brand .client-logo .client-subtitle {
    color: #999;
    font-size: 0.75rem;
    margin: 0;
}

.login-brand .product-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-brand .product-name h3 {
    color: var(--accent);
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: 1.5rem;
}

.login-brand .product-name .login-brand-icon {
    display: flex;
    align-items: center;
    gap: 2px;
}

.login-brand .product-name .login-brand-icon .bar {
    display: inline-block;
    border-radius: 3px;
    transform-origin: bottom center;
}

.login-brand .product-name .login-brand-icon .bar-1 {
    width: 5px;
    height: 18px;
    background-color: var(--accent);
    transform: rotate(15deg);
}

.login-brand .product-name .login-brand-icon .bar-2 {
    width: 5px;
    height: 14px;
    background-color: var(--gold);
    transform: rotate(-5deg);
    margin-left: -1px;
}

.login-brand .product-name .login-brand-icon .bar-3 {
    width: 5px;
    height: 20px;
    background-color: #1D4D66;
    transform: rotate(10deg);
    margin-left: -1px;
}

.login-brand p {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ---- Pagination ---- */
.pagination .page-link {
    color: var(--accent);
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---- Template Card Grid ---- */
.template-card {
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.template-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.template-card .template-preview {
    height: 180px;
    overflow: hidden;
    background-color: #f0f0f0;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.75rem;
    color: #666;
    padding: 0.75rem;
    line-height: 1.4;
}

/* ---- Progress Bar Custom ---- */
.progress-campaign {
    height: 0.5rem;
    border-radius: 1rem;
}

/* ---- Flash Messages ---- */
.flash-container {
    position: relative;
    z-index: 10;
}

/* ---- Unsubscribe Page ---- */
.unsubscribe-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--content-bg);
}

.unsubscribe-card {
    max-width: 480px;
    width: 100%;
    text-align: center;
}

/* ---- Chart Container ---- */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-backdrop.show {
        display: block;
    }

    .sidebar-toggle {
        display: inline-block;
    }

    .main-content {
        margin-left: 0;
    }
}

/* ---- Import Results ---- */
.import-results .result-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
}

/* ---- Action Buttons Group ---- */
.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* ---- Scrollbar (sidebar) ---- */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

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