/**
 * Marketing Analytics Platform
 * Main Styles
 */

/* ===== Variables ===== */
:root {
    --sidebar-width: 280px;
    --header-height: 70px;
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #198754;
    --info: #0dcaf0;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #212529;
    --sidebar-bg: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #212529;
    background-color: #f5f6fa;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 28px;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-item {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: #ffc107;
}

.sidebar-link i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: #f5f6fa;
}

.main-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-wrapper {
    padding: 30px;
}

/* ===== Cards ===== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    background: white;
}

.card-stats {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-stats:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.card-secondary-stats {
    border-left: 3px solid var(--primary);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e9ecef;
    padding: 20px;
}

.card-body {
    padding: 20px;
}

/* ===== Icon Circle ===== */
.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.icon-circle.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.icon-circle.bg-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
}

.icon-circle.bg-success {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
}

.icon-circle.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

/* ===== Badges ===== */
.badge {
    padding: 6px 12px;
    font-weight: 600;
    border-radius: 6px;
}

.bg-success-soft {
    background-color: #d1e7dd;
    color: #0f5132;
}

.bg-danger-soft {
    background-color: #f8d7da;
    color: #842029;
}

/* ===== Avatar ===== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 8px;
    bottom: -16px;
    width: 2px;
    background: #e9ecef;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-icon {
    position: absolute;
    left: -30px;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 1;
}

.timeline-icon.bg-primary {
    background: var(--primary);
}

.timeline-icon.bg-warning {
    background: var(--warning);
}

.timeline-icon.bg-success {
    background: var(--success);
}

.timeline-icon.bg-info {
    background: var(--info);
}

.timeline-icon.bg-secondary {
    background: var(--secondary);
}

.timeline-content {
    padding-left: 0;
}

.timeline-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

/* ===== Table ===== */
.table {
    color: #212529;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* ===== Buttons ===== */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* ===== Utilities ===== */
.text-muted {
    color: #6c757d !important;
}

.fw-semibold {
    font-weight: 600;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ===== Scrollbar ===== */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}