/* ============================================================================
   DASHBOARD VISUAL BOUNDARIES - GLOBAL STYLES
   Version: 1.0
   Last Updated: 2025-01-10

   Purpose: Provides consistent section boundaries across all dashboards
   to prevent "big blob of white" appearance
   ============================================================================ */

/* ===== DASHBOARD HEADER SECTION ===== */
.dashboard-header {
    background: linear-gradient(135deg, var(--lp-slate-50, #F8FAFC) 0%, white 100%);
    border: 1px solid var(--lp-slate-200, #E2E8F0);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* ===== ENHANCED CARD STYLES ===== */
.dashboard-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
    background: white;
}

.dashboard-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ===== SECTION WRAPPERS ===== */

/* Stats/Metrics Section */
.stats-section {
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

/* Onboarding Section */
.onboarding-section {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.03) 0%, rgba(124, 58, 237, 0.03) 100%);
    border: 1px solid var(--lp-purple-200, #C4B5FD);
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* Key Panels Section (3-column layouts) */
.key-panels-section {
    margin-bottom: 2rem;
}

.key-panels-section .dashboard-card {
    background: white;
    position: relative;
}

/* Toolkit/Tools Section */
.toolkit-section {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(3, 105, 161, 0.03) 0%, rgba(14, 165, 233, 0.03) 100%);
    border: 1px solid var(--lp-primary-200, #BAE6FD);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.toolkit-section .dashboard-card {
    border-color: var(--lp-primary-300, #7DD3FC);
    background: white;
}

/* Goals/Content Section */
.goals-coaching-section,
.content-section {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.5) 0%, white 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* Resources/Learning Section */
.resources-section {
    padding: 1.5rem;
    background: linear-gradient(135deg, white 0%, rgba(224, 242, 254, 0.3) 100%);
    border-radius: 12px;
    border: 1px solid rgba(186, 230, 253, 0.5);
    margin-bottom: 2rem;
}

/* Activity/Feed Section */
.activity-section {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, white 100%);
    border-radius: 12px;
    border: 1px solid var(--lp-slate-200, #E2E8F0);
    margin-bottom: 2rem;
}

/* Analytics/Reports Section */
.analytics-section {
    padding: 1.5rem;
    background: linear-gradient(135deg, white 0%, rgba(224, 242, 254, 0.2) 100%);
    border-radius: 12px;
    border: 1px solid var(--lp-primary-200, #BAE6FD);
    margin-bottom: 2rem;
}

/* Gamification Section */
.gamification-section {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.02) 0%, rgba(139, 92, 246, 0.02) 100%);
    border-radius: 12px;
    border: 1px solid var(--lp-purple-200, #C4B5FD);
    margin-bottom: 2rem;
}

/* ===== RESPONSIVE TOOLTIP FIXES ===== */

/* Prevent tooltip collision on mobile/tablet */
@media (max-width: 991px) {
    /* Change popover placement to top or bottom on smaller screens */
    .popover {
        max-width: 280px !important;
    }

    /* Ensure popovers don't overflow */
    .help-icon {
        position: relative;
        z-index: 10;
    }

    /* Adjust button spacing to prevent overlap */
    .card-header .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-header .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Force popovers to stay within viewport */
    .popover {
        position: fixed !important;
    }
}

@media (max-width: 576px) {
    /* On mobile, make tooltips even more compact */
    .popover {
        max-width: 240px !important;
        font-size: 0.85rem;
    }

    .popover-header {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    .popover-body {
        padding: 0.5rem 0.75rem;
    }

    /* Reduce section padding on mobile */
    .onboarding-section,
    .toolkit-section,
    .goals-coaching-section,
    .content-section,
    .resources-section,
    .activity-section,
    .analytics-section,
    .gamification-section {
        padding: 1rem !important;
    }

    /* Stack header elements vertically on small screens */
    .dashboard-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
        padding: 1rem;
    }

    .dashboard-header > div:last-child {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===== UTILITY CLASSES ===== */

/* Section dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--lp-slate-200, #E2E8F0) 50%, transparent 100%);
    margin: 2rem 0;
}

/* Subtle section backgrounds */
.section-bg-primary {
    background: linear-gradient(135deg, rgba(3, 105, 161, 0.02) 0%, rgba(14, 165, 233, 0.02) 100%);
}

.section-bg-success {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.02) 0%, rgba(45, 212, 191, 0.02) 100%);
}

.section-bg-purple {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.02) 0%, rgba(139, 92, 246, 0.02) 100%);
}

.section-bg-slate {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.5) 0%, white 100%);
}

/* Section borders */
.section-border-primary {
    border: 1px solid var(--lp-primary-200, #BAE6FD);
}

.section-border-success {
    border: 1px solid var(--lp-success-200, #99F6E4);
}

.section-border-purple {
    border: 1px solid var(--lp-purple-200, #C4B5FD);
}

.section-border-slate {
    border: 1px solid var(--lp-slate-200, #E2E8F0);
}

/* Rounded corners */
.section-rounded {
    border-radius: 12px;
}

/* Section padding variations */
.section-padding-sm {
    padding: 1rem;
}

.section-padding-md {
    padding: 1.5rem;
}

.section-padding-lg {
    padding: 2rem;
}

/* ===== ACCESSIBILITY ===== */

/* Ensure focus states are visible */
.dashboard-card:focus-within {
    outline: 2px solid var(--lp-primary-500, #0EA5E9);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .dashboard-card {
        transition: none;
    }
}
