/* Agent Community Manager — Custom Styles */

:root {
    --tenant-primary: #0d6efd;
    --tenant-accent: #dc3545;
    --primary-gradient: linear-gradient(135deg, var(--tenant-primary), color-mix(in srgb, var(--tenant-primary) 70%, white));
    --card-radius: 1rem;
    --transition-speed: 0.2s;
    --sidebar-width: 220px;
}

/* ══ Bootstrap overrides (tenant colors) ══ */
.bg-primary  { background-color: var(--tenant-primary) !important; }
.text-primary { color: var(--tenant-primary) !important; }
.btn-primary  { background-color: var(--tenant-primary) !important; border-color: var(--tenant-primary) !important; }
.btn-primary:hover { filter: brightness(0.88); }
.btn-outline-primary { color: var(--tenant-primary) !important; border-color: var(--tenant-primary) !important; }
.btn-outline-primary:hover { background-color: var(--tenant-primary) !important; color: #fff !important; }
.border-primary { border-color: var(--tenant-primary) !important; }
.badge.bg-primary { background-color: var(--tenant-primary) !important; }
.bg-danger   { background-color: var(--tenant-accent) !important; }
.text-danger  { color: var(--tenant-accent) !important; }
.btn-danger   { background-color: var(--tenant-accent) !important; border-color: var(--tenant-accent) !important; }
.btn-danger:hover { filter: brightness(0.88); }
.btn-outline-danger { color: var(--tenant-accent) !important; border-color: var(--tenant-accent) !important; }
.btn-outline-danger:hover { background-color: var(--tenant-accent) !important; color: #fff !important; }

/* ══ Typography ══ */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #212529;
}

/* ══ Smooth transitions ══ */
a, .btn, .card {
    transition: all var(--transition-speed) ease;
}

/* ══════════════════════════════════════════════════════════════
   APP LAYOUT — Sidebar (desktop) + Bottom nav (mobile)
   ══════════════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.app-sidebar {
    display: none; /* hidden on mobile */
}

/* ── Main area ── */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Toolbar ── */
.app-toolbar {
    background: #fff;
    border-bottom: 1px solid #e8eaf0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.toolbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1a1a2e;
}
.toolbar-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    filter: none;
}
.toolbar-logo-icon {
    font-size: 1.1rem;
    color: var(--tenant-primary);
}
.toolbar-name {
    font-weight: 800;
    font-size: .9rem;
}

.toolbar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1rem;
    color: #1a1a2e;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-user-btn {
    display: flex;
    align-items: center;
    color: #6c757d;
    font-size: 1.4rem;
    text-decoration: none;
}
.toolbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* ── Content ── */
.app-content {
    flex: 1;
    padding: 20px 16px;
    padding-bottom: calc(20px + 64px + env(safe-area-inset-bottom, 0px)); /* room for bottom nav */
}

/* ══ Notification bell ══ */
.notif-bell-btn {
    position: relative;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--tenant-primary), color-mix(in srgb, var(--tenant-primary) 60%, #6610f2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform .15s ease;
}
.notif-bell-btn:hover { transform: scale(1.05); }
.notif-bell-btn i { color: #fff; font-size: 1rem; }
.notif-bell-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff3b30;
    border: 2.5px solid #fff;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: .6rem;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ══ Bottom Navigation (mobile) ══ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1.5px solid #e8eaf0;
    display: flex;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)) 4px;
    z-index: 1040;
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.bnav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bnav-icon {
    width: 40px;
    height: 28px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #9ca3af;
    transition: all .2s ease;
}
.bnav-lbl {
    font-size: .62rem;
    color: #9ca3af;
    font-weight: 600;
    transition: color .2s ease;
}
.bnav-tab.active .bnav-icon {
    background: linear-gradient(135deg, var(--tenant-primary), color-mix(in srgb, var(--tenant-primary) 70%, #000));
    color: #fff;
}
.bnav-tab.active .bnav-lbl {
    color: var(--tenant-primary);
    font-weight: 800;
}
.bnav-tab.console-tab .bnav-icon { color: #dc3545; }
.bnav-tab.console-tab.active .bnav-icon {
    background: linear-gradient(135deg, #dc3545, #9d1b2c);
    color: #fff;
}
.bnav-tab.console-tab.active .bnav-lbl { color: #dc3545; }

/* ══════════════════════════════════════════════════════════════
   DESKTOP (≥992px) — Sidebar visible, bottom nav hidden
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 992px) {
    .app-sidebar {
        display: flex;
        flex-direction: column;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
        background: #fff;
        border-right: 1px solid #e8eaf0;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        overflow-y: auto;
    }

    .app-main {
        margin-left: var(--sidebar-width);
    }

    .app-content {
        padding: 24px 32px;
        padding-bottom: 24px; /* no bottom nav on desktop */
    }

    .bottom-nav {
        display: none !important;
    }

    /* Sidebar components */
    .sb-brand {
        padding: 16px;
        border-bottom: 1px solid #f0f0f8;
    }
    .sb-brand-link {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: #1a1a2e;
    }
    .sb-logo {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--tenant-primary), color-mix(in srgb, var(--tenant-primary) 70%, #000));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        color: #fff;
        flex-shrink: 0;
    }
    .sb-logo-img {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        object-fit: cover;
        flex-shrink: 0;
    }
    .sb-name {
        font-weight: 800;
        font-size: .82rem;
        color: #1a1a2e;
        line-height: 1.2;
    }
    .sb-role {
        font-size: .6rem;
        color: #9ca3af;
        font-weight: 600;
    }

    .sb-nav {
        flex: 1;
        padding: 10px 10px;
    }
    .sb-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 12px;
        border-radius: 10px;
        font-size: .82rem;
        color: #6c757d;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 2px;
        text-decoration: none;
        transition: all .15s ease;
    }
    .sb-item:hover {
        background: #f8f9fc;
        color: #374151;
    }
    .sb-item.active {
        background: linear-gradient(135deg, var(--tenant-primary), color-mix(in srgb, var(--tenant-primary) 70%, #000));
        color: #fff;
    }
    .sb-item.active:hover { color: #fff; }
    .sb-item i {
        font-size: .95rem;
        width: 20px;
        text-align: center;
    }
    .sb-badge {
        margin-left: auto;
        background: #ff3b30;
        color: #fff;
        font-size: .52rem;
        font-weight: 800;
        padding: 1px 6px;
        border-radius: 8px;
    }
    .sb-divider {
        height: 1px;
        background: #f0f0f8;
        margin: 8px 12px;
    }

    /* Console item (rouge) */
    .sb-console { color: #dc3545; font-weight: 700; }
    .sb-console.active {
        background: linear-gradient(135deg, #dc3545, #9d1b2c);
        color: #fff;
    }

    .sb-footer {
        padding: 12px;
        border-top: 1px solid #f0f0f8;
    }
    .sb-user-link {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: #1a1a2e;
        padding: 6px 8px;
        border-radius: 10px;
        transition: background .15s;
    }
    .sb-user-link:hover { background: #f8f9fc; }
    .sb-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--tenant-primary), color-mix(in srgb, var(--tenant-primary) 60%, #6610f2));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: .8rem;
        color: #fff;
        flex-shrink: 0;
    }
    .sb-avatar-img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }
    .sb-user-info { flex: 1; min-width: 0; }
    .su-name {
        font-size: .75rem;
        font-weight: 700;
        color: #1a1a2e;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .su-role {
        font-size: .58rem;
        color: #9ca3af;
    }
    .sb-user-dots {
        font-size: .8rem;
        color: #d1d5db;
    }
}

/* ══════════════════════════════════════════════════════════════
   EXISTING COMPONENT STYLES
   ══════════════════════════════════════════════════════════════ */

/* Cards */
.card { border-radius: var(--card-radius); }
.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1) !important;
}
.media-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
}

/* Buttons */
.btn { border-radius: 0.5rem; }
.btn-lg { border-radius: 0.6rem; padding: 0.6rem 1.5rem; }

/* Form controls */
.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: #dee2e6;
    padding: 0.55rem 0.85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--tenant-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.1);
}
textarea.form-control { resize: vertical; min-height: 80px; }

/* Badges */
.badge { font-weight: 500; letter-spacing: 0.02em; }

/* Alerts */
.alert { border-radius: 0.75rem; border: none; }

/* Upload drop zone */
#drop-zone {
    transition: background-color 0.2s ease, border-color 0.2s ease;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#drop-zone:hover { background-color: rgba(0, 58, 112, 0.08) !important; }

/* Step indicators */
.step-circle {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.9rem; line-height: 1;
}

/* Workflow sidebar */
.workflow-steps .step-icon { min-width: 32px; }

/* Network cards in generator */
.network-option { transition: all 0.2s ease; cursor: pointer; user-select: none; }
.network-option:hover { transform: translateY(-2px); }
.network-option.selected { background-color: rgba(0, 58, 112, 0.05) !important; border-color: #003A70 !important; }

/* Textarea review cards */
.card textarea.form-control { font-size: 0.9rem; line-height: 1.6; border-color: #e9ecef; }
.card textarea.form-control:focus { border-color: var(--tenant-primary); }

/* Gallery grid */
#media-grid .card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
#media-grid .card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* Loading overlay */
#loading-overlay { backdrop-filter: blur(4px); }

/* Breadcrumb */
.breadcrumb { font-size: 0.875rem; }
.breadcrumb-item a { color: var(--tenant-primary); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

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

/* Responsive tweaks */
@media (max-width: 576px) {
    h2.fw-bold { font-size: 1.4rem; }
    .btn-lg { padding: 0.5rem 1.2rem; font-size: 0.95rem; }
}

/* Print styles */
@media print {
    .app-sidebar, .app-toolbar, .bottom-nav, .btn, .messages-container {
        display: none !important;
    }
    .app-main { margin-left: 0 !important; }
}

/* Cursor pointer utility */
.cursor-pointer { cursor: pointer; }
.border-2 { border-width: 2px !important; }
.border-start.border-4 { border-left-width: 4px !important; }

/* Social network colors */
.text-facebook { color: #1877F2 !important; }
.text-instagram { color: #E1306C !important; }
.text-twitter { color: #1d9bf0 !important; }
.text-linkedin { color: #0A66C2 !important; }
.text-wordpress { color: #21759B !important; }
.bg-facebook { background-color: #1877F2 !important; }
.bg-instagram { background-color: #E1306C !important; }
.bg-twitter { background-color: #1d9bf0 !important; }
.bg-wordpress { background-color: #21759B !important; }

/* Animated badge */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.badge-pulse { animation: pulse 2s infinite; }
