:root {
    --bs-body-font-family: 'IRANSans', system-ui, -apple-system, sans-serif;
    --insta-primary: #E1306C;
    --insta-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --whatsapp-primary: #25D366;
    --whatsapp-dark: #075E54;
    --sidebar-width: 280px;
    --header-height: 60px;
    --bs-primary: #E1306C; /* Override Bootstrap Primary */
    --bs-primary-rgb: 225, 48, 108;
}

body {
    background-color: #f4f6f9;
    font-family: var(--bs-body-font-family) !important;
    color: #262626;
    overflow-x: hidden;
}

/* WhatsApp specific styles */
.text-whatsapp {
    color: var(--whatsapp-primary) !important;
}

.bg-whatsapp {
    background-color: var(--whatsapp-primary) !important;
    color: white;
}

.btn-whatsapp {
    background-color: var(--whatsapp-primary);
    color: white;
    border: none;
}

.btn-whatsapp:hover {
    background-color: var(--whatsapp-dark);
    color: white;
}

.nav-pills .nav-link.active.whatsapp-tab {
    background-color: var(--whatsapp-primary);
}

/* AI Specific Styles */
.btn-ai-suggestion {
    background: linear-gradient(to right, #fff, #f8f9fa);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-ai-suggestion:hover {
    border-color: #833ab4;
    box-shadow: 0 2px 8px rgba(131, 58, 180, 0.15);
    transform: translateY(-1px);
}

.btn-ai-suggestion i {
    background: -webkit-linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-ai {
    background: linear-gradient(45deg, #405de6, #833ab4);
    color: white;
    font-size: 0.7rem;
    padding: 0.25em 0.6em;
    border-radius: 10rem;
}

/* Feature Modal */
.modal-feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* --- Global Components --- */

/* Buttons */
.btn-primary {
    background-color: var(--insta-primary);
    border-color: var(--insta-primary);
}

.btn-primary:hover {
    background-color: #a92b70;
    border-color: #a92b70;
}

.btn-outline-primary {
    color: var(--insta-primary);
    border-color: var(--insta-primary);
}

.btn-outline-primary:hover {
    background-color: var(--insta-primary);
    border-color: var(--insta-primary);
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05); /* Softer shadow */
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.card:hover {
    /* Only hover effect for interactive cards */
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #efefef;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 1rem 1.25rem;
}

/* Navbar */
.navbar {
    background-color: #fff !important;
    border-bottom: 1px solid #dbdbdb !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
    height: 70px;
}

.navbar-brand {
    font-weight: bold;
    color: #262626;
}

/* --- Sidebar --- */
#sidebar-wrapper {
    min-height: 100vh;
    width: var(--sidebar-width);
    margin-right: 0;
    transition: margin 0.25s ease-out;
    background: #fff;
    border-left: 1px solid #dbdbdb;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
}

#wrapper.toggled #sidebar-wrapper {
    margin-right: calc(var(--sidebar-width) * -1);
}

#page-content-wrapper {
    width: 100%;
    padding-right: var(--sidebar-width);
    transition: padding 0.25s ease-out;
}

#wrapper.toggled #page-content-wrapper {
    padding-right: 0;
}

.sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.4rem; /* Slightly larger */
    font-weight: bold;
    color: #262626;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 70px; /* Match navbar height */
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.list-group-item {
    border: none;
    padding: 0.85rem 1.25rem;
    color: #555;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 0.5rem;
    margin: 2px 10px;
    display: flex;
    align-items: center;
}

.list-group-item i {
    width: 25px;
    text-align: center;
    font-size: 1.1rem;
}

.list-group-item:hover {
    background-color: #fafafa;
    color: var(--insta-primary);
    transform: translateX(-3px);
}

.list-group-item.active {
    background-color: #fff0f5; /* Very light pink */
    color: var(--insta-primary);
    border: none;
    font-weight: bold;
}

/* --- Specific Components --- */

/* Stat Cards (Dashboard/Analytics) */
.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Chat Interface (Inbox) */
.chat-list {
    height: calc(100vh - 180px);
    overflow-y: auto;
}

.chat-box {
    height: calc(100vh - 250px);
    overflow-y: auto;
    background-color: #fdfdfd;
    padding: 20px;
    border-radius: 1rem;
}

.message {
    margin-bottom: 15px;
    max-width: 75%;
    clear: both;
}

.message-content {
    padding: 10px 15px;
    border-radius: 15px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message.received {
    float: right;
}

.message.received .message-content {
    background-color: #fff;
    border: 1px solid #efefef;
    border-bottom-right-radius: 2px;
}

.message.sent {
    float: left;
}

.message.sent .message-content {
    background: var(--insta-gradient);
    color: white;
    border-bottom-left-radius: 2px;
}

.avatar {
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* AI Badge */
.badge-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

/* Calendar */
.calendar-day {
    min-height: 120px;
    border-color: #efefef !important;
    padding: 5px;
    background: #fff;
    transition: background 0.2s;
}

/* --- AI Chat Widget --- */
#ai-chat-widget-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1050;
    font-family: 'IRANSans', sans-serif;
}

#ai-chat-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
    background-size: 200% 200%;
    animation: ai-pulse 2s infinite;
    border: none;
    box-shadow: 0 4px 15px rgba(131, 58, 180, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ai-chat-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(131, 58, 180, 0.6);
}

@keyframes ai-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(131, 58, 180, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(131, 58, 180, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(131, 58, 180, 0);
    }
}

#ai-chat-window {
    position: absolute;
    bottom: 85px;
    left: 0;
    width: 350px;
    height: 480px;
    border-radius: 1.2rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
    background: #fff;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#ai-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    background-color: #f8f9fa;
    scroll-behavior: smooth;
}

.ai-message-bubble {
    background: #fff;
    border-radius: 12px 12px 12px 2px;
    padding: 10px 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444;
    border: 1px solid #f0f0f0;
}

.user-message-bubble {
    background: var(--insta-gradient);
    color: white;
    border-radius: 12px 12px 2px 12px;
    padding: 10px 15px;
    font-size: 0.9rem;
    line-height: 1.6;
}
