/* Custom styles for FinDash Flask app - Material Design Dark */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    background: #0f0f0f;
    background-image:
        radial-gradient(at 0% 0%, rgba(187, 134, 252, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(3, 218, 198, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #e0e0e0;
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

.main-content {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.hero-section {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.08) 0%, rgba(3, 218, 198, 0.05) 100%);
    border-radius: 20px;
    margin: 2rem 0;
    padding: 4rem 3rem;
    border: 1px solid rgba(187, 134, 252, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #bb86fc, #03dac6, #bb86fc);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.hero-section h1 {
    color: #ffffff;
    font-weight: 700;
    font-size: 3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-section h2 {
    color: #03dac6;
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.hero-section p {
    color: #b0b0b0;
    font-size: 1.1rem;
}

.card {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(37, 37, 37, 0.95) 100%);
    backdrop-filter: blur(10px);
    margin-bottom: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(187, 134, 252, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.6);
    transform: translateY(-6px);
    border-color: rgba(187, 134, 252, 0.4);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.1) 0%, rgba(3, 218, 198, 0.05) 100%);
    border-bottom: 1px solid rgba(187, 134, 252, 0.2);
    border-radius: 12px 12px 0 0 !important;
    color: #ffffff;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.card-body {
    color: #e0e0e0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
}

.navbar {
    background: rgba(20, 20, 20, 0.95) !important;
    border-bottom: 1px solid rgba(187, 134, 252, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #ffffff !important;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    background: rgba(187, 134, 252, 0.1);
    transform: translateY(-2px);
}

.navbar-brand i {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-text {
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    gap: 0.5rem;
}

.nav-link {
    color: #b0b0b0 !important;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem 1.25rem !important;
    border-radius: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.1), rgba(3, 218, 198, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link:hover {
    color: #ffffff !important;
    transform: translateY(-2px);
}

.nav-link i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-link:hover i {
    transform: scale(1.1);
}

.navbar-toggler {
    border: 1px solid rgba(187, 134, 252, 0.3);
    padding: 0.5rem 0.75rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(187, 134, 252, 0.25);
}

.nav-tabs {
    border-bottom: 1px solid #2d2d2d;
}

.nav-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
    background: transparent;
    color: #b0b0b0;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.05);
}

.nav-tabs .nav-link.active {
    background: #1e1e1e;
    color: #bb86fc;
    border-bottom: 2px solid #bb86fc;
}

.btn-primary {
    background: linear-gradient(135deg, #bb86fc, #9d6ee8);
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-weight: 600;
    color: #000000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(187, 134, 252, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #9d6ee8, #bb86fc);
    box-shadow: 0 6px 20px rgba(187, 134, 252, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #03dac6, #02b3a5);
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-weight: 600;
    color: #000000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(3, 218, 198, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #02b3a5, #03dac6);
    box-shadow: 0 6px 20px rgba(3, 218, 198, 0.4);
    transform: translateY(-2px);
}

.btn-warning {
    background: #cf6679;
    border: none;
    border-radius: 4px;
    padding: 10px 24px;
    font-weight: 500;
    color: #ffffff;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.btn-warning:hover {
    background: #b85565;
    box-shadow: 0 4px 12px rgba(207, 102, 121, 0.3);
}

.table {
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
}

.table thead th {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.15) 0%, rgba(3, 218, 198, 0.1) 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    padding: 1.25rem 1rem;
}

.table tbody td {
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    font-size: 0.9rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-striped tbody tr:hover {
    background-color: rgba(187, 134, 252, 0.1);
    transition: background-color 0.2s ease;
}

.form-control,
.form-select {
    border-radius: 4px;
    border: 1px solid #3d3d3d;
    background: #2d2d2d;
    color: #e0e0e0;
    transition: all 0.2s ease;
    padding: 0.625rem 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #bb86fc;
    box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.2);
    background: #2d2d2d;
    color: #e0e0e0;
    outline: none;
}

.form-control::placeholder {
    color: #6d6d6d;
}

.form-label {
    color: #b0b0b0;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.alert {
    border-radius: 4px;
    border: none;
    font-weight: 400;
    padding: 1rem 1.25rem;
}

.alert-success {
    background: rgba(3, 218, 198, 0.15);
    color: #03dac6;
    border-left: 4px solid #03dac6;
}

.alert-warning {
    background: rgba(207, 102, 121, 0.15);
    color: #cf6679;
    border-left: 4px solid #cf6679;
}

.alert-danger {
    background: rgba(207, 102, 121, 0.15);
    color: #cf6679;
    border-left: 4px solid #cf6679;
}

.container-fluid {
    max-width: 100%;
}

/* Material elevation */
.elevation-1 {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.elevation-2 {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.elevation-3 {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Chart containers with better styling */
.chart-container {
    min-height: 450px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-container:hover {
    border-color: rgba(187, 134, 252, 0.3);
    box-shadow: 0 0 20px rgba(187, 134, 252, 0.1);
}

.chart-donut {
    min-height: 500px;
}

#time-chart {
    min-height: 500px;
}

#hour-chart {
    min-height: 450px;
}

/* Chart notification */
.chart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    color: #000000;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Chart expand button */
.chart-expand-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
    z-index: 50;
    position: relative;
}

.chart-expand-btn:hover {
    background: rgba(187, 134, 252, 0.2);
    border-color: rgba(187, 134, 252, 0.5);
    color: #ffffff;
    transform: scale(1.1);
}

/* Chart modal */
.chart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.chart-modal-content {
    background: linear-gradient(135deg, #1e1e1e 0%, #252525 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 1600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(187, 134, 252, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(187, 134, 252, 0.2);
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.1) 0%, rgba(3, 218, 198, 0.05) 100%);
}

.chart-modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
}

.chart-modal-header .btn {
    padding: 0.5rem 0.75rem;
}

.chart-modal-body {
    padding: 2rem;
    overflow: auto;
    max-height: calc(90vh - 100px);
}

#modalChartContainer {
    min-height: 600px;
}

/* Responsive grid gaps */
.g-4 {
    gap: 1.5rem !important;
}

/* Better filter layout */
.filter-card .card-body {
    padding: 2rem;
}

.filter-group {
    height: 100%;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .chart-container {
        min-height: 350px;
    }

    .chart-donut {
        min-height: 400px;
    }

    .category-filters {
        max-height: 200px;
    }
}

/* Hero icon styling */
.hero-icon {
    font-size: 5rem;
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Feature cards */
.feature-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.feature-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.5rem;
}

.feature-card .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.feature-card .btn i {
    transition: transform 0.3s ease;
}

.feature-card:hover .btn i {
    transform: translateX(5px);
}

/* Info card */
.info-card {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.05) 0%, rgba(3, 218, 198, 0.05) 100%);
    border: 1px solid rgba(187, 134, 252, 0.2);
}

.info-card h4 {
    color: #ffffff;
    font-weight: 600;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.2), rgba(3, 218, 198, 0.2));
    border-radius: 50px;
    border: 1px solid rgba(187, 134, 252, 0.3);
}

.ai-badge i {
    font-size: 2rem;
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-badge span {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

.row>[class*='col-'] {
    animation: fadeIn 0.6s ease-out;
}

.row>[class*='col-']:nth-child(2) {
    animation-delay: 0.1s;
}

.row>[class*='col-']:nth-child(3) {
    animation-delay: 0.2s;
}

/* Better form styling */
select.form-control option {
    background: #2d2d2d;
    color: #e0e0e0;
}



/* Chart containers */
#time-chart,
#week-chart,
#month-chart,
#hour-chart,
#cat-chart,
#card-chart {
    min-height: 400px;
}

/* Resizable charts */
.resizable-chart-col {
    position: relative;
    transition: flex 0.1s ease;
}

.resizable-card {
    position: relative;
}

.resize-handle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    cursor: nwse-resize;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    z-index: 100;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle:hover {
    background: rgba(187, 134, 252, 0.3);
    transform: scale(1.1);
}

.resize-handle::before {
    content: '';
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 14px 14px;
    border-color: transparent transparent rgba(187, 134, 252, 0.7) transparent;
    transition: all 0.2s ease;
}

.resize-handle:hover::before {
    border-color: transparent transparent rgba(187, 134, 252, 1) transparent;
    border-width: 0 0 16px 16px;
}

.resize-handle::after {
    content: '⋰';
    position: absolute;
    right: 7px;
    bottom: 3px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    pointer-events: none;
}

.resize-handle:hover::after {
    color: rgba(255, 255, 255, 1);
}

/* Draggable charts */
.draggable-header {
    cursor: move;
}

.resizable-chart-col[draggable="true"] {
    transition: opacity 0.2s ease;
}

.resizable-chart-col.dragging {
    opacity: 0.5;
}

.bi-grip-vertical {
    color: rgba(187, 134, 252, 0.6);
    transition: color 0.2s ease;
}

.draggable-header:hover .bi-grip-vertical {
    color: #bb86fc;
}

/* Draggable metrics */
.draggable-metric {
    cursor: move;
    transition: opacity 0.2s ease;
}

.metric-drag-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    color: rgba(187, 134, 252, 0.4);
    font-size: 1.2rem;
    cursor: move;
    transition: color 0.2s ease;
    z-index: 10;
}

.metric-card:hover .metric-drag-handle {
    color: #bb86fc;
}

h1 {
    color: #ffffff;
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h2 {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.75rem;
    letter-spacing: -0.01em;
}

h3 {
    color: #03dac6;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

h4,
h5 {
    color: #e0e0e0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h6 {
    color: #b0b0b0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

p,
span,
div {
    color: #b0b0b0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section h2 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }
}

/* Loading spinner */
.spinner-border {
    color: #bb86fc;
}

/* Page header styling */
.page-header {
    margin-bottom: 2rem;
    position: relative;
    z-index: 100;
    background: transparent;
    padding: 1rem 0;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.page-title i {
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: #b0b0b0;
    font-size: 1.1rem;
    margin: 0;
}

.header-actions .btn {
    display: flex;
    align-items: center;
}

/* Metric cards */
.metric-card {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.08) 0%, rgba(3, 218, 198, 0.05) 100%);
    border: 1px solid rgba(187, 134, 252, 0.15);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.metric-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(187, 134, 252, 0.5);
    box-shadow: 0 16px 48px rgba(187, 134, 252, 0.3);
}

.metric-icon {
    font-size: 2.5rem;
}

.metric-label {
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Filter card */
.filter-card {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.05) 0%, rgba(3, 218, 198, 0.03) 100%);
}

.filter-card .card-header {
    border-bottom: 1px solid rgba(187, 134, 252, 0.15);
}

.filter-group {
    margin-bottom: 0;
}

.filter-label {
    display: flex;
    align-items: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-label i {
    color: #bb86fc;
}

.filter-select {
    height: auto !important;
    padding: 0.5rem;
}

.filter-select option {
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 2px;
}

.filter-select option:checked {
    background: linear-gradient(135deg, #bb86fc, #03dac6) !important;
    color: #000000 !important;
}

/* Source filters with color coding */
.source-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.source-checkbox {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.source-checkbox:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(187, 134, 252, 0.3);
}

.source-checkbox input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.source-label {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    transition: all 0.2s ease;
}

/* Source-specific colors */
.source-wise-cap {
    background: rgba(0, 217, 255, 0.2);
    color: #00D9FF;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.source-wise-dock {
    background: rgba(255, 20, 147, 0.2);
    color: #FF1493;
    border: 1px solid rgba(255, 20, 147, 0.3);
}

.source-rev-cap {
    background: rgba(255, 140, 0, 0.2);
    color: #FF8C00;
    border: 1px solid rgba(255, 140, 0, 0.3);
}

.source-rev-dock {
    background: rgba(147, 112, 219, 0.2);
    color: #9370DB;
    border: 1px solid rgba(147, 112, 219, 0.3);
}

.source-wise {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.source-revolut {
    background: rgba(255, 68, 68, 0.2);
    color: #FF4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.source-checkbox input[type="checkbox"]:checked+.source-label {
    font-weight: 600;
    transform: scale(1.05);
}

/* Category filters with color coding */
.category-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.category-filters::-webkit-scrollbar {
    width: 6px;
}

.category-filters::-webkit-scrollbar-thumb {
    background: rgba(187, 134, 252, 0.5);
    border-radius: 3px;
}

.category-checkbox {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.category-checkbox:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateX(4px);
}

.category-checkbox input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.category-label {
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    transition: all 0.2s ease;
    border: 1px solid;
    display: flex;
    align-items: center;
    flex: 1;
}

.category-checkbox input[type="checkbox"]:checked+.category-label {
    font-weight: 600;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Button styling */
.btn-outline-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* Chart cards */
.chart-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(37, 37, 37, 0.98) 100%);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(187, 134, 252, 0.25);
    border-color: rgba(187, 134, 252, 0.4);
}

.chart-card .card-header {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.08) 0%, rgba(3, 218, 198, 0.05) 100%);
    border-bottom: 1px solid rgba(187, 134, 252, 0.2);
}

.chart-card .card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.chart-card .card-header i {
    color: #bb86fc;
}

/* Badge styling */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #bb86fc, #9d6ee8) !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #3d3d3d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4d4d4d;
}

/* Rounded bar chart styling via CSS */
.js-plotly-plot .plot .barlayer .trace .bars path {
    rx: 8px !important;
    ry: 8px !important;
}

.js-plotly-plot .plot .barlayer .trace .point path {
    rx: 8px !important;
    ry: 8px !important;
}

/* DataTables Pagination - Complete Override */
.dataTables_wrapper .dataTables_paginate {
    padding-top: 1.5rem;
}

.dataTables_wrapper .dataTables_paginate * {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #b0b0b0 !important;
    padding: 0.5rem 0.75rem !important;
    margin: 0 0.25rem !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #FCD34D !important;
    background: rgba(252, 211, 77, 0.15) !important;
    background-color: rgba(252, 211, 77, 0.15) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    color: #000 !important;
    background: linear-gradient(135deg, #FCD34D, #60A5FA) !important;
    background-color: #FCD34D !important;
    font-weight: 700 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #444 !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: none !important;
    background-color: transparent !important;
}

/* Active filter badges */
.active-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(187, 134, 252, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(187, 134, 252, 0.2);
}

.active-filters .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: default;
    animation: slideIn 0.3s ease;
}

.active-filters .badge i {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.active-filters .badge i:hover {
    transform: scale(1.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table row selection */
#transactionsTable tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

#transactionsTable tbody tr.selected {
    background: linear-gradient(90deg, rgba(187, 134, 252, 0.3), rgba(3, 218, 198, 0.2)) !important;
    border-left: 4px solid #bb86fc !important;
    font-weight: 600;
}

#transactionsTable tbody tr:hover {
    background: rgba(187, 134, 252, 0.15) !important;
    transform: translateX(4px);
}



/* Embed mode adjustments */
body.embed-mode {
    padding: 0;
    margin: 0;
}

body.embed-mode .overview-content {
    padding: 1rem;
}

/* FAB Container */
.fab-container {
    position: fixed;
    bottom: 30px;
    left: 15px;
    z-index: 999;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    color: #000;
    border: none;
    box-shadow: 0 8px 32px rgba(187, 134, 252, 0.5);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    position: relative;
    z-index: 1001;
}

.fab-main:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 48px rgba(187, 134, 252, 0.7);
}

.fab-main i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-options {
    position: absolute;
    bottom: 70px;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(20px);
}

.fab-options.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.fab-option {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
    color: #fff;
    border: 2px solid rgba(187, 134, 252, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    text-decoration: none;
    opacity: 0;
    transform: scale(0);
    animation: fabOptionAppear 0.3s ease forwards;
}

.fab-options.open .fab-option:nth-child(1) {
    animation-delay: 0.05s;
}

.fab-options.open .fab-option:nth-child(2) {
    animation-delay: 0.1s;
}

.fab-options.open .fab-option:nth-child(3) {
    animation-delay: 0.15s;
}

.fab-options.open .fab-option:nth-child(4) {
    animation-delay: 0.2s;
}

.fab-options.open .fab-option:nth-child(5) {
    animation-delay: 0.25s;
}

@keyframes fabOptionAppear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fab-option:hover {
    transform: scale(1.15) translateX(5px);
    background: linear-gradient(135deg, #bb86fc, #03dac6);
    color: #000;
    border-color: rgba(187, 134, 252, 0.8);
    box-shadow: 0 6px 24px rgba(187, 134, 252, 0.5);
}

.fab-option i {
    transition: transform 0.3s ease;
}

.fab-option:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* Print styles for high quality PDF */
@media print {
    body {
        background: white;
        color: black;
    }

    .fab-container,
    .filters-sidebar,
    .filters-toggle-btn,
    .layout-lock-btn,
    .resize-handle {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 20px;
        border: 1px solid #ddd;
    }

    .chart-container {
        background: white !important;
    }

    .overview-content {
        padding: 0;
    }
}


/* ============================================
   DYNAMIC SCALING FOR EMBED MODE
   ============================================ */

/* Scale entire overview content based on container width */
body.embed-mode .overview-content {
    transform-origin: top left;
    width: 100%;
}

/* Apply dynamic scaling using CSS custom properties */
body.embed-mode {
    --scale-factor: 1;
}

/* Scale based on viewport width */
@media (max-width: 1400px) {
    body.embed-mode {
        --scale-factor: 0.85;
    }

    body.embed-mode .overview-content {
        transform: scale(var(--scale-factor));
        width: calc(100% / var(--scale-factor));
    }
}

@media (max-width: 1200px) {
    body.embed-mode {
        --scale-factor: 0.75;
    }

    body.embed-mode .overview-content {
        transform: scale(var(--scale-factor));
        width: calc(100% / var(--scale-factor));
    }
}

@media (max-width: 1000px) {
    body.embed-mode {
        --scale-factor: 0.65;
    }

    body.embed-mode .overview-content {
        transform: scale(var(--scale-factor));
        width: calc(100% / var(--scale-factor));
    }
}

@media (max-width: 800px) {
    body.embed-mode {
        --scale-factor: 0.55;
    }

    body.embed-mode .overview-content {
        transform: scale(var(--scale-factor));
        width: calc(100% / var(--scale-factor));
    }
}

@media (max-width: 600px) {
    body.embed-mode {
        --scale-factor: 0.45;
    }

    body.embed-mode .overview-content {
        transform: scale(var(--scale-factor));
        width: calc(100% / var(--scale-factor));
    }
}

/* Scale FAB proportionally in embed mode */
body.embed-mode .fab-container {
    transform: scale(var(--scale-factor));
    transform-origin: bottom left;
    z-index: 2000;
}

/* Ensure FAB options scale correctly */
body.embed-mode .fab-options {
    transform-origin: bottom left;
}

/* Keep sidebar at full size in embed mode - no scaling */
body.embed-mode .filters-sidebar {
    transform: none !important;
    width: 350px;
    z-index: 2100;
    position: fixed;
    left: -350px;
    top: 0;
    height: 100vh;
}

body.embed-mode .filters-sidebar.active {
    left: 0 !important;
}

/* Scale navbar in embed mode to match content */
body.embed-mode .navbar {
    transform: scale(var(--scale-factor));
    transform-origin: top left;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 1000;
    width: calc(100% / var(--scale-factor));
}

/* Adjust main content positioning for scaled navbar */
body.embed-mode .main-content {
    margin-top: 0;
    padding-top: 0;
}

/* Ensure content starts right after navbar */
body.embed-mode .overview-content {
    margin-top: 0;
}