.card-main {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    border-radius: 16px;
    border: 1px solid var(--Gray-Gray-100) !important;
    padding: 16px;
    width: 100%;
    box-shadow: none !important;
    /* height: 100%; */
}
.card-main div h6::before,
#select-contract-page .card-main div:nth-child(1) > span::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -9px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    z-index: -1;
    background-color: var(--Gray-Gray-200);
}
.dark-page .card-main div h6::before,
.dark-page #select-contract-page .card-main div:nth-child(1) > span::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -9px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    z-index: 1;
    background-color: var(--Gray-Gray-200);
}
.card-main a > span::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -9px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    z-index: -1;
    background-color: var(--Secondary-Yellow-400);
}
.dark-page .card-main a > span::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -9px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    z-index: 1;
    background-color: var(--Secondary-Yellow-100);
}
#dashboard-page .card-main span {
    font-size: 18px;
    font-family: 'Nunito';
}
.card-main h6 {
    font-size: 18px;
    font-family: 'Nunito';
    /* position: relative; */
}

/* Original Text color for p tags within card-main */
#dashboard-page.card-main div p {
    color: #8E8EB8 !important;
}

#dashboard-page .dark-page .card-main div p {
    color: #B4B4D0 !important;
}

/* Original Styles for the first link/button within card-main */
.card-main:nth-child(1) a {
    background: var(--Light-Gradient);
    border: 1px solid var(--Light-Gradient);
    color: var(--Gray-Not-White);
    width: fit-content;
}

.dark-page .card-main:nth-child(1) a {
    background: var(--Dark-Gradient);
    border: 1px solid var(--Light-Gradient);
    color: var(--Gray-Not-White);
    width: fit-content;
}

.card-main .chart {
    position: relative;
    width: 250px;
    height: 250px;
}
.chart-canvas {
    position: relative;
    z-index: 1;
}
.chart-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-80%, -40%);
    text-align: center;
}
.chart-label__heading {
    font-size: 14px;
    font-weight: 700;
    font-family: 'Nunito';
    color: var( --Gray-Gray-600);
}
.dark-page .chart-label__heading {
    font-size: 14px;
    font-weight: 700;
    font-family: 'Nunito';
    color: var( --Gray-Gray-400);
}
.chart-label__sub {
    font-size: 24px;
    color: #666666;
}

/* --- NEW: Reviews Section Card Styles (Distinct and Comprehensive) --- */
.reviews-section-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    border-radius: 16px;
    border: 1px solid var(--Gray-Gray-100) !important;
    padding: 16px;
    width: 100%;
    height: 100%;
    box-shadow: none !important;
    box-sizing: border-box;
    background-color: var(--Gray-Gray-100) !important; /* Explicitly set background to gray */
}

/* --- Specific Styles for elements *within* reviews-section-card --- */

/* Pseudo-element for h6 (e.g., "Reviews" title) within reviews-section-card */
.reviews-section-card div h6::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -9px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    z-index: -1;
    background-color: var(--Gray-Gray-200);
}

.dark-page .reviews-section-card div h6::before {
    z-index: 1;
    background-color: var(--Gray-Gray-200);
}

/* Dark mode styles for reviews-section-card */
.dark-page .reviews-section-card {
    background-color: #232338 !important;
    border-color: rgba(85, 119, 154, 0.2784313725) !important;
    box-shadow: none !important;
}

.dark-page .reviews-section-card h6 {
    color: #F7F7F7 !important;
}

.dark-page .reviews-section-card .text-dark {
    color: #61A8E6 !important;
}

.dark-page .reviews-section-card .list-group-item {
    background-color: transparent !important;
    border-color: rgba(85, 119, 154, 0.2784313725) !important;
}

.dark-page .reviews-section-card .progress {
    background-color: rgba(39, 48, 71, 0.6705882353) !important;
}

.dark-page .reviews-section-card .list-group-item .ms-auto.text-sm.font-weight-bold,
.dark-page .reviews-section-card .list-group-item .me-2.text-sm.font-weight-bold.text-dark {
    color: #61A8E6 !important;
}

/* Additional dark mode styles for reviews section */
.dark-page .reviews-section-card .list-group-item.px-0 {
    background-color: transparent !important;
}

.dark-page .reviews-section-card .progress {
    background-color: rgba(39, 48, 71, 0.6705882353) !important;
}

.dark-page .reviews-section-card .progress-bar.bg-yellow {
    background-color: #FFC000 !important;
}

.dark-page .reviews-section-card .review-header h6 {
    color: #F7F7F7 !important;
}

.dark-page .reviews-section-card .review-body .text-dark {
    color: #61A8E6 !important;
}

/* Pseudo-element for links with a span inside within reviews-section-card */
.reviews-section-card a > span::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -9px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    z-index: -1;
    background-color: var(--Secondary-Yellow-400);
}

.dark-page .reviews-section-card a > span::before {
    z-index: 1;
    background-color: var(--Secondary-Yellow-100);
}

/* Font sizes for spans and h6 within reviews-section-card */
.reviews-section-card span {
    font-size: 18px !important; /* Enforce font size */
    font-family: 'Nunito' !important; /* Enforce font family */
}

.reviews-section-card h6 {
    font-size: 18px !important; /* Enforce font size */
    font-family: 'Nunito' !important; /* Enforce font family */
    position: relative;
}

/* Text color for p tags within reviews-section-card */
.reviews-section-card div p {
    color: #8E8EB8 !important;
}

.dark-page .reviews-section-card div p {
    color: #B4B4D0 !important;
}
/* Chart specific styles within reviews-section-card */
.reviews-section-card .chart {
    position: relative;
    width: 500px;
    height: 250px;
}

/* --- General Resets for the new review sections (already specific to review-*) --- */
.review-header,
.review-body {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.review-header {
    margin-bottom: 16px;
}

.review-body {
    flex-grow: 1;
    margin-bottom: 16px;
}

/* --- Progress Bar Animation Fix (scoped to dashboard) --- */
#dashboard-page .progress-bar {
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
}

#dashboard-page .progress-bar.progress-bar-animated,
#dashboard-page .progress-bar.progress-bar-striped {
    animation: none !important;
}

/* --- Text Color Readability Fix (already specific) --- */
.review-body .text-dark {
    color: #343a40 !important;
}

.list-group-item .ms-auto.text-sm.font-weight-bold,
.list-group-item .me-2.text-sm.font-weight-bold.text-dark {
    color: #343a40 !important;
}

/* --- Yellow Progress Bar --- */
.progress-bar.bg-yellow {
    background-color: #FFC000 !important;
}

/* --- Progress Bar Alignment and Visibility Fixes (scoped to dashboard) --- */
#dashboard-page .progress {
    display: flex;
    height: 0.5rem !important;
    overflow: hidden;
    background-color: #ffffff !important;
    border-radius: 0.25rem;
    margin-left: 0 !important;
    padding-left: 0 !important;
    flex-grow: 1;
    width: 100% !important;
}

#dashboard-page .progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    margin: 0 !important;
    padding: 0 !important;
    left: 0 !important;
    transform: none !important;
    min-width: 0% !important;
}

.list-group-item > .w-100 > div {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.list-group-item.px-0 {
    padding-left: 0 !important;
    padding-right: 0 !important;
    background-color: var(--Gray-Gray-40) !important;
}

/* --- Tooltip Button Styles --- */
.tooltip-btn {
    padding: 4px 6px !important;
    border-radius: 50% !important;
    border: 1px solid #17a2b8 !important;
    background-color: transparent !important;
    color: #17a2b8 !important;
    font-size: 12px !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.tooltip-btn:hover {
    background-color: #17a2b8 !important;
    color: white !important;
    transform: scale(1.1) !important;
}

.tooltip-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25) !important;
    outline: none !important;
}

/* Dark mode tooltip button styles */
.dark-page .tooltip-btn {
    border-color: #61A8E6 !important;
    color: #61A8E6 !important;
}

.dark-page .tooltip-btn:hover {
    background-color: #61A8E6 !important;
    color: #232338 !important;
}

.dark-page .tooltip-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(97, 168, 230, 0.25) !important;
}

/* Small tooltip buttons for budget items */
.tooltip-btn.btn-xs {
    width: 20px !important;
    height: 20px !important;
    padding: 2px 4px !important;
    font-size: 10px !important;
}

/* Tooltip positioning adjustments */
.tooltip {
    font-size: 12px !important;
    max-width: 300px !important;
    z-index: 1050 !important;
}

.tooltip .tooltip-inner {
    background-color: #333 !important;
    color: white !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    text-align: left !important;
    line-height: 1.4 !important;
}

.dark-page .tooltip .tooltip-inner {
    background-color: #232338 !important;
    color: #F7F7F7 !important;
    border: 1px solid #61A8E6 !important;
}

/* --- Demo Tutorial Overlay Styles --- */
.demo-tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.demo-tutorial-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.demo-tutorial-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.demo-tutorial-tooltip {
    position: absolute;
    --demo-tooltip-bg: #ffffff;
    --demo-tooltip-border: rgba(0, 0, 0, 0.08);
    background: var(--demo-tooltip-bg);
    border: 1px solid var(--demo-tooltip-border);
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    max-width: 350px;
    z-index: 10001;
    pointer-events: auto;
    animation: demoTooltipFadeIn 0.3s ease-out;
}

.demo-tooltip-arrow {
    display: none !important;
}

.demo-tooltip-inner {
    padding: 20px;
    text-align: center;
}

.demo-tooltip-inner h6 {
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 16px;
}

.demo-tooltip-inner p {
    color: #666;
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.demo-tutorial-controls {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10001;
    pointer-events: auto;
}

.demo-tutorial-controls .btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#demo-skip-btn {
    background: linear-gradient(90deg, #61A8E6 0%, #1D70B7 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 8px 18px rgba(29, 112, 183, 0.25);
}

#demo-prev-btn {
    background: transparent !important;
    border: 2px solid rgba(142, 142, 184, 1) !important;
    color: rgba(142, 142, 184, 1) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

#demo-prev-btn:disabled {
    opacity: 0.6;
    box-shadow: none !important;
    cursor: not-allowed;
}

#demo-next-btn {
    background: transparent !important;
    border: 2px solid rgba(255, 192, 0, 1) !important;
    color: rgba(255, 192, 0, 1) !important;
    box-shadow: 0 8px 18px rgba(255, 192, 0, 0.25);
}

.demo-tutorial-controls .btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

/* Dark mode styles for demo tutorial */
.dark-page .demo-tutorial-tooltip {
    --demo-tooltip-bg: #232338;
    --demo-tooltip-border: rgba(97, 168, 230, 0.35);
    background: var(--demo-tooltip-bg);
    border: 1px solid var(--demo-tooltip-border);
    box-shadow: 0 12px 35px rgba(10, 20, 40, 0.45);
}

.dark-page .demo-tooltip-inner h6 {
    color: #F7F7F7;
}

.dark-page .demo-tooltip-inner p {
    color: #B4B4D0;
}

/* Animation for tooltip appearance */
@keyframes demoTooltipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Highlight effect for focused element */
.demo-highlight {
    position: relative;
    z-index: 10000;
    animation: demoHighlight 2s infinite;
}

@keyframes demoHighlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(23, 162, 184, 0.1);
    }
}
