/* Main Styles for Fiacore */

/* Modern Expense Breakdown Chart Styling */
.chart-container {
    position: relative;
    transition: all 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

#expenseBreakdownChart {
    border-radius: 12px;
    transition: filter 0.3s ease;
}

/* Enhanced legend styling for expense breakdown */
.chart-container .chartjs-legend {
    margin-top: 20px;
}

.chart-container .chartjs-legend ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.chart-container .chartjs-legend li {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.chart-container .chartjs-legend li:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.chart-container .chartjs-legend li.hidden {
    opacity: 0.4;
    text-decoration: line-through;
    background: rgba(239, 68, 68, 0.05);
}

.chart-container .chartjs-legend li span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Dynamic Page Layout System */
.analysis-page-container {
    min-height: 100vh;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

/* Professional Chart Spacing with Dynamic Margins */
.analysis-card {
    margin: 2.5rem 1rem !important; /* Professional spacing on all sides */
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    min-height: 300px; /* Minimum height for consistency */
}

.analysis-card:last-child {
    margin-bottom: 2.5rem !important; /* Consistent bottom margin */
}

/* Summary Cards with Dynamic Spacing - REMOVED DUPLICATE - handled in dynamic-summary-cards.css */

/* Chart Container with Dynamic Height */
.chart-container {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* TARGETED SPACING SYSTEM - Only for dashboard and analysis pages */
#dashboard-container .row.mb-4,
#dashboard-container .row.g-4,
.analysis-container .row.mb-4,
.analysis-container .row.g-4 {
    margin-bottom: 12px !important;
    --bs-gutter-x: 12px !important;
    --bs-gutter-y: 0 !important;
}

/* Summary cards - let Bootstrap grid handle spacing */

/* Chart columns spacing */
.analysis-container .row.mb-4 .col-lg-6,
.analysis-container .row.mb-4 .col-lg-12,
.analysis-container .row.mb-4 .col-12 {
    padding-left: 6px !important;
    padding-right: 6px !important;
    margin-bottom: 0 !important;
}

/* Side-by-side layout spacing */
.side-by-side-layout {
    --bs-gutter-x: 12px !important;
    --bs-gutter-y: 0 !important;
    margin-bottom: 12px !important;
}

.side-by-side-layout .col-lg-6 {
    padding-left: 6px !important;
    padding-right: 6px !important;
}

/* Edit Mode Enhanced Spacing - FIXED: Using consistent mb-4 spacing instead of hardcoded margins */
.edit-mode-active .analysis-card {
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    outline: none !important;
    /* REMOVED: margin: 3.5rem 1.5rem !important; - using Bootstrap mb-4 instead */
    transform: translateY(0);
    transition: all 0.3s ease, transform 0.2s ease;
}

.edit-mode-active .analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}

/* Edit Mode Summary Card Styling - FIXED: Consistent spacing without hardcoded margins */
.edit-mode-active .summary-card {
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    outline: none !important;
    /* REMOVED: margin: 2.5rem 1rem !important; - using default Bootstrap spacing */
}

/* Dynamic Content Adjustment */
.container-fluid {
    padding: 0 15px;
    max-width: none;
    width: 100%;
}

/* Responsive Spacing Adjustments */
@media (max-width: 768px) {
    .analysis-card {
        /* REMOVED: margin: 1.5rem 0.5rem !important; - using Bootstrap mb-4 */
    }
    
    .edit-mode-active .analysis-card {
        /* REMOVED: margin: 2rem 0.5rem !important; - using Bootstrap mb-4 */
    }
    
    /* REMOVED DUPLICATE RESPONSIVE SUMMARY CARD - handled in dynamic-summary-cards.css */
}

/* Smooth Page Height Transitions */
body {
    transition: height 0.3s ease;
    overflow-x: hidden;
}

.analysis-content {
    width: 100%;
    overflow: visible;
}

/* Drag Handle Styling */
.drag-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #3b82f6;
    color: white;
    border-radius: 6px;
    padding: 8px;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.edit-mode-active .drag-handle {
    opacity: 1;
}

.drag-handle:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Metric Card Styles for Financial Ratios & Trends Section */
.metric-card {
    background: #ffffff;
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-card:hover {
    border: none !important;
    border-left: none !important;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Removed loan-summary-container and health-metrics-container CSS */

/* Chart Styles - Allow proper chart display */
.borrowing-chart-container canvas,
.lending-chart-container canvas,
#lendingChart,
#borrowingChart {
    display: block !important;
}

/* Enable chart elements for borrowing dashboard */
.borrowing-chart-container .chartjs-axis-title,
.lending-chart-container .chartjs-axis-title {
    display: block !important;
}

/* 
 * Base Styles 
 */
:root {
    --border-radius: 0.5rem;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --transition-speed: 0.3s;
    --content-width: 1200px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 
 * Layout Components 
 */
.container-fluid {
    max-width: none !important;
    width: 100% !important;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 2rem;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    height: auto !important;
    max-height: none !important;
}

.main-container {
    flex: 1;
}

.main-divider {
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    margin: 1rem 0 2rem;
    opacity: 0.8;
    border-radius: 2px;
}


.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
    margin: 0 0.25rem;
}

.nav-link:hover {
    background-color: var(--hover-tab);
}

.nav-link.active {
    background-color: var(--primary);
    color: var(--bg) !important;
    font-weight: 600;
}

.theme-selector, .user-menu-btn {
    background-color: var(--chart-bg);
    color: var(--text);
    border: 1px solid var(--grid);
    transition: all var(--transition-speed) ease;
}

.theme-selector:hover, .user-menu-btn:hover {
    background-color: var(--hover-tab);
    color: var(--primary);
    border-color: var(--primary);
}

/* 
 * Date Range Selectors 
 */
.date-range-card {
    background-color: var(--chart-bg);
    border: 1px solid var(--grid);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.date-icon {
    color: var(--primary);
}

.quick-ranges .btn {
    background-color: var(--chart-bg);
    color: var(--text);
    border: 1px solid var(--grid);
}

.quick-ranges .btn:hover {
    background-color: var(--hover-tab);
    color: var(--primary);
    border-color: var(--primary);
}

/* 
 * Dashboard Cards 
 */
.dashboard-card {
    background: var(--chart-bg);
    color: var(--text);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 235px;
    width: 100%;
    box-shadow: var(--box-shadow);
    transition: 
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
        box-shadow 0.22s cubic-bezier(.4,.8,.3,1), 
        border-color 0.22s cubic-bezier(.4,.8,.3,1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    border: 1px solid var(--grid);
    flex: 1 1 0;
    height: 100%;
}

.dashboard-card.hover-glow:hover {
    box-shadow: 0 2px 12px 0 rgba(var(--primary-rgb), 0.2), 0 2px 8px 0 rgba(0, 0, 0, 0.1);
    border-color: rgba(var(--primary-rgb), 0.5);
    z-index: 10;
    transform: translateY(-2px) scale(1.015);
}

/* CRITICAL: Remove ALL card borders to prevent blue lines on summary cards */
.card, .card *, .bg-white, .bg-white *, .rounded-3, .rounded-3 *, .shadow-sm, .shadow-sm *,
#dynamic-summary-cards-container, #dynamic-summary-cards-container *,
[class*="col-"], [class*="row"], [class*="card-style-"],
.summary-card, .summary-card *, [data-summary-card], [data-summary-card] * {
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-width: 0 !important;
    outline: none !important;
}

/* Override Bootstrap default card borders */
.card {
    border: none !important;
}

/* Loan Card Blue Border Override */
.loan-card-with-border {
    border: 1px solid #3b82f6 !important;
}

/* Removed blue border from dashboard cards to prevent blue lines on summary cards */
.dashboard-card.alert-glow,
.dashboard-card.alert-glow:hover {
    border-left: none !important;
    animation: alertpulse 1.1s infinite alternate;
}

@keyframes alertpulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.2), 0 2px 18px 0 rgba(var(--accent-rgb), 0.1); }
    100% { box-shadow: 0 0 8px 2px rgba(var(--accent-rgb), 0.3), 0 2px 18px 0 rgba(var(--accent-rgb), 0.1); }
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
    color: var(--secondary);
}

.card-value {
    font-size: 2.1rem;
    line-height: 2.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    margin-top: 0.15rem;
    color: var(--primary);
    transition: color 0.3s;
}

.card-subtext {
    color: var(--text);
    opacity: 0.82;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 6px;
    margin-top: .7rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s cubic-bezier(.4,2.3,.3,1);
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card-footer {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--secondary);
    margin-top: 0.5rem;
}

/* 
 * Metric Grid for Dashboard Cards 
 */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .dashboard-card { 
        min-height: 170px; 
        font-size: 0.95rem; 
        padding: 1.2rem; 
    }
    .card-value { 
        font-size: 1.5rem; 
    }
    .metric-grid { 
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    }
}

@media (max-width: 900px) {
    .dashboard-card { 
        min-height: 120px; 
        padding: 1rem 0.5rem;
    }
    .card-value { 
        font-size: 1.2rem; 
    }
    .metric-grid { 
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    }
}

/* 
 * Page Titles and Section Headers 
 */
.page-title {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.page-title small {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.8;
}

.section-title {
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--grid);
}

/* 
 * Table Styles 
 */
.table {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    color: var(--text);
}

.table th {
    color: var(--secondary);
    border-color: var(--grid);
    font-weight: 600;
}

.table td {
    border-color: var(--grid);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
}

/* 
 * Form Controls 
 */
.form-control, .form-select {
    background-color: var(--chart-bg);
    border-color: var(--grid);
    color: var(--text);
}

.form-control:focus, .form-select:focus {
    background-color: var(--chart-bg);
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.25);
}

.input-group-text {
    background-color: var(--hover-tab);
    border-color: var(--grid);
    color: var(--text);
}

/* 
 * Buttons 
 */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25) !important;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4) !important;
    color: white !important;
    border: none !important;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

/* Override for customize buttons - force blue color */
.customize-btn.btn-outline-primary {
    color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    background-color: transparent !important;
}

.customize-btn.btn-outline-primary:hover,
.customize-btn.btn-outline-primary:focus {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}



.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

/* Removed duplicate forecast button styling - now handled in templates/analysis/index.html */

.view-details-btn {
    background-color: var(--hover-tab);
    color: var(--text);
    border: 1px solid var(--grid);
    transition: all var(--transition-speed) ease;
}

.view-details-btn:hover {
    background-color: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

/* 
 * Progress Bars for Loans and Borrowings 
 */
.loan-progress, .borrowing-progress {
    height: 20px !important;
    background-color: var(--grid);
}

.loan-progress .progress-bar, .borrowing-progress .progress-bar {
    transition: width 1s ease-in-out;
}

/* 
 * Cards for Actions 
 */
.action-card {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.action-card:hover {
    text-decoration: none;
    color: inherit;
}

.category-card {
    background-color: var(--chart-bg);
    border-color: var(--grid);
    transition: all var(--transition-speed) ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary);
}

/* 
 * Authentication Forms 
 */
.auth-card {
    background-color: var(--chart-bg);
    border-color: var(--grid);
    box-shadow: var(--box-shadow);
    max-width: 500px;
    margin: 2rem auto;
}

.auth-card .card-header {
    background-color: var(--hover-tab);
    border-color: var(--grid);
    color: var(--primary);
}

.toggle-password {
    background-color: var(--hover-tab);
    border-color: var(--grid);
    color: var(--text);
}

.profile-card, .admin-card {
    background-color: var(--chart-bg);
    border-color: var(--grid);
}

.profile-info th {
    color: var(--secondary);
    width: 40%;
    padding-left: 0;
}

.profile-info td {
    padding-right: 0;
}


.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(var(--color) 0% calc(var(--score) * 1%), var(--grid) calc(var(--score) * 1%) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: var(--chart-bg);
    z-index: 1;
}

.score-value {
    position: relative;
    z-index: 2;
    font-size: 3rem;
    font-weight: 700;
    color: var(--color);
}

.score-label {
    position: relative;
    z-index: 2;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
}

/* 
 * CSV Import Styles 
 */
.import-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.import-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-number {
    background-color: var(--primary);
    color: var(--bg);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h5 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* 
 * No-data state messages 
 */
.no-data-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 2rem;
    color: var(--secondary);
    text-align: center;
}

.no-data-message i {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 
 * Footer Styles 
 */
.footer {
    background-color: var(--bg);
    border-top: 1px solid var(--grid);
    color: var(--text);
    opacity: 0.8;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* 
 * Accordion customization 
 */
.accordion-item {
    background-color: var(--chart-bg);
    border-color: var(--grid);
}

.accordion-button {
    background-color: var(--hover-tab);
    color: var(--text);
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary);
    color: var(--bg);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.25);
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* 
 * Tabs customization 
 */
.nav-tabs {
    border-color: var(--grid);
}

.nav-tabs .nav-link {
    color: var(--text);
    background-color: transparent;
    border-color: transparent;
}

.nav-tabs .nav-link:hover {
    border-color: transparent transparent var(--grid);
    isolation: isolate;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background-color: var(--chart-bg);
    border-color: var(--grid) var(--grid) var(--chart-bg);
}

/* 
 * Modal customization 
 */
.modal-content {
    background-color: var(--chart-bg);
    color: var(--text);
    border-color: var(--grid);
}

.modal-header {
    border-color: var(--grid);
}

.modal-footer {
    border-color: var(--grid);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* 
 * Badge and alerts customization 
 */
.badge {
    font-weight: 600;
}

.alert {
    background-color: var(--chart-bg);
    border-left-width: 4px;
}

.alert-info {
    border-left-color: #0dcaf0;
    color: var(--text);
}

.alert-warning {
    border-left-color: #ffc107;
    color: var(--text);
}

.alert-danger {
    border-left-color: #dc3545;
    color: var(--text);
}

.alert-success {
    border-left-color: #28a745;
    color: var(--text);
}

/* fadeIn keyframes in core-animations.css */

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* 
 * Utility classes 
 */
.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--secondary) !important;
}

.text-accent {
    color: var(--accent) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.bg-secondary {
    background-color: var(--secondary) !important;
}

.bg-accent {
    background-color: var(--accent) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

/* Responsive Goal Action Buttons */
.goal-action-btn {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    transition: all 0.3s ease;
    position: relative;
    padding: 0 !important;
    min-width: 50px !important;
}

.goal-action-btn .btn-text {
    display: none !important;
}

.goal-action-btn:hover {
    transform: scale(1.1);
}

/* Show text on larger screens (tablets and above) */
@media (min-width: 992px) {
    .goal-action-btn {
        width: auto !important;
        min-width: 120px !important;
        border-radius: 25px !important;
        padding: 8px 16px !important;
    }
    
    .goal-action-btn .btn-text {
        display: inline !important;
    }
}

/* ================================
   GLOBAL DELETE CONFIRMATION STYLES
   ================================ */

/* Custom Delete Modal for entire website */
.global-delete-modal {
    display: none;
    position: fixed;
    z-index: 99999 !important;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7));
    backdrop-filter: blur(8px);
    animation: fadeInModal 0.3s ease;
    align-items: center;
    justify-content: center;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.global-delete-modal.show {
    display: flex !important;
}

.global-delete-modal .delete-modal-content {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 32px;
    width: 90%;
    max-width: 420px;
    min-height: auto;
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: auto;
    flex-shrink: 0;
}

.global-delete-modal .delete-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.global-delete-modal .delete-modal-content:hover::before {
    left: 100%;
}

.global-delete-modal .delete-modal-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

.global-delete-modal .delete-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.global-delete-modal .delete-modal-message {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.global-delete-modal .delete-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.global-delete-modal .delete-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    min-width: 100px;
}

.global-delete-modal .cancel-btn {
    background: linear-gradient(145deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.global-delete-modal .cancel-btn:hover {
    background: linear-gradient(145deg, #5a6268, #3d4449);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(108, 117, 125, 0.4);
}

.global-delete-modal .confirm-btn {
    background: linear-gradient(145deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.global-delete-modal .confirm-btn:hover {
    background: linear-gradient(145deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(220, 53, 69, 0.4);
}

/* Mobile responsive adjustments for delete modal */
@media (max-width: 768px) {
    .global-delete-modal {
        padding: 15px;
    }
    
    .global-delete-modal .delete-modal-content {
        width: 95%;
        max-width: 350px;
        padding: 24px;
        margin: 0;
    }
    
    .global-delete-modal .delete-modal-icon {
        font-size: 2.5rem !important;
    }
    
    .global-delete-modal .delete-modal-title {
        font-size: 1.3rem !important;
    }
    
    .global-delete-modal .delete-btn {
        padding: 12px 18px !important;
        font-size: 0.95rem !important;
        min-width: 90px !important;
    }
    
    .global-delete-modal .delete-modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
}

/* Delete modal animations */
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(0);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* bounce keyframes in core-animations.css */

/* Global delete button styling */
.global-delete-btn {
    background: linear-gradient(145deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.global-delete-btn:hover {
    background: linear-gradient(145deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.global-delete-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Goal hero card styling */
.goal-hero-card {
    background: linear-gradient(135deg, #EEF2FF 0%, #F1F5F9 100%) !important;
}

/* ================================
   CELEBRATION MODAL STYLES
   ================================ */

.celebration-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: celebrationFadeIn 0.5s ease;
}

.celebration-modal.show {
    display: flex !important;
}

/* Goal Completed Animation */
.goal-completed-animation {
    animation: completedPulse 2s ease-in-out infinite;
    border: 2px solid #10b981 !important;
}

@keyframes completedPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
        transform: scale(1.02);
    }
}

.celebration-trophy {
    animation: trophyBounce 1s ease-in-out infinite;
}

@keyframes trophyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.celebration-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    animation: celebrationBounce 0.6s ease;
    position: relative;
    overflow: hidden;
}

.celebration-icon {
    font-size: 4rem;
    color: #f59e0b;
    margin-bottom: 20px;
    animation: trophyPulse 2s infinite;
}

.celebration-title {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
}

.celebration-message {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 25px;
}

.celebration-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
    color: #2c3e50;
}

.stat-item i {
    color: #10b981;
    width: 20px;
}

.celebration-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.celebration-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* Confetti Animation */
.celebration-confetti {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.celebration-confetti::before,
.celebration-confetti::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f59e0b;
    animation: confettiFall 3s infinite;
}

.celebration-confetti::before {
    left: 20%;
    animation-delay: 0s;
}

.celebration-confetti::after {
    right: 20%;
    animation-delay: 1s;
    background: #10b981;
}

/* ================================
   SIMULATOR MODAL STYLES
   ================================ */

.simulator-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.simulator-modal.show {
    display: flex !important;
}

.simulator-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideInBounce 0.4s ease;
}

.simulator-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 15px 15px 0 0;
}

.simulator-header h4 {
    margin: 0;
    flex: 1;
}

.simulator-header .btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
}

.simulator-header .btn-close:hover {
    opacity: 1;
}

.simulator-body {
    padding: 25px;
}

.simulator-results {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.result-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.result-item .label {
    font-weight: 500;
    color: #6c757d;
}

.result-item .value {
    font-weight: bold;
    color: #2c3e50;
}

/* ================================
   ANIMATION KEYFRAMES
   ================================ */

@keyframes celebrationFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes celebrationBounce {
    0% {
        transform: scale(0.3) translateY(-50px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes trophyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .celebration-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .celebration-title {
        font-size: 1.5rem;
    }
    
    .celebration-message {
        font-size: 1rem;
    }
    
    .simulator-content {
        width: 95%;
        margin: 20px;
    }
    
    .simulator-header {
        padding: 15px;
    }
    
    .simulator-body {
        padding: 20px;
    }
}


/* DISABLED: Enhanced smooth scrolling causing scroll pause effect */
body {
    /* DISABLED: scroll-behavior: smooth !important; */
    -webkit-overflow-scrolling: touch;
    /* DISABLED: -webkit-transform: translateZ(0); */
    /* DISABLED: transform: translateZ(0); */
    /* DISABLED: backface-visibility: hidden; */
    /* DISABLED: perspective: 1000; */
    /* DISABLED: will-change: scroll-position; */
}

/* Categories list height fixes */
.categories-list {
    height: auto !important;
    min-height: 400px;
    max-height: none !important;
    overflow-y: visible !important;
}

.top-categories {
    height: auto !important;
    min-height: 600px;
    overflow-y: visible !important;
}

/* Fullscreen modal references removed as requested */

/* FIACORE BLUE STYLING - OVERRIDE DASHBOARD.CSS */
:root {
    --fiacore-primary: #3b82f6 !important;
    --fiacore-primary-dark: #1d4ed8 !important;
    --fiacore-primary-light: #93c5fd !important;
    --success: #3b82f6 !important;
    --primary: #3b82f6 !important;
    --info: #3b82f6 !important;
    --warning: #3b82f6 !important;
}

/* High specificity selectors to override dashboard.css */
.container-fluid h1,
.container-fluid h2, 
.container-fluid h3,
.container-fluid h4,
.container-fluid h5,
.container-fluid h6,
.container-fluid .text-primary,
.container-fluid .card-title,
.page-title,
h1.text-primary,
h2.text-primary,
h3.text-primary,
h4.text-primary,
h5.text-primary,
h6.text-primary,
.fw-bold.text-primary,
.fw-semibold.text-primary {
    color: var(--fiacore-primary) !important;
    font-weight: 600 !important;
}

/* Specific goals page styling */
.container-fluid h1.page-title {
    color: var(--fiacore-primary) !important;
    font-weight: 700 !important;
    font-size: 2.25rem !important;
}

.container-fluid .h5.font-weight-bold,
.container-fluid .h5.mb-0,
.container-fluid h5 {
    color: var(--fiacore-primary) !important;
}

/* Additional goals page overrides */
.h3.mb-0.text-primary,
.h5.mb-0.font-weight-bold {
    color: var(--fiacore-primary) !important;
}

/* Fix all icon colors to Fiacore blue - ALL ICON TYPES */
.fas.text-success,
.fas.text-warning,
.fas.text-info,
.far.text-success,
.far.text-warning,
.far.text-info,
.fab.text-success,
.fab.text-warning,
.fab.text-info,
.fa-solid.text-success,
.fa-solid.text-warning,
.fa-solid.text-info,
.fa-regular.text-success,
.fa-regular.text-warning,
.fa-regular.text-info,
.text-success i,
.text-warning i,
.text-info i,
.text-success,
.text-warning,
.text-info,
.feature-icon,
.feature-card i {
    color: var(--fiacore-primary, #3b82f6) !important;
}

/* Force all green elements to blue */
.btn-success {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%) !important;
    border: none !important;
    color: white !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%) !important;
    border: none !important;
    color: white !important;
}

/* Enhanced button styling for goals page */
.btn-enhanced {
    font-weight: 600 !important;
    border-radius: 10px !important;
    padding: 12px 28px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.btn-enhanced:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3) !important;
}

/* Card enhancements */
.card-enhanced {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
}

.card-enhanced:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

/* Feature cards styling */
.feature-card {
    cursor: pointer;
    transition: all 0.3s ease !important;
}

.feature-card:hover {
    background: rgba(59, 130, 246, 0.02) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}
