/**
 * Custom Color Overrides for Bario
 * Primary color changed to green theme
 */

:root,
[data-bs-theme=light] {
    /* Main green color - balanced, more vibrant */
    --bs-primary: #10b981;
    --bs-primary-rgb: 16, 185, 129;

    /* Button colors */
    --bs-btn-bg: #10b981;
    --bs-btn-border-color: #10b981;
    --bs-btn-hover-bg: #059669;
    --bs-btn-hover-border-color: #059669;
    --bs-btn-active-bg: #047857;
    --bs-btn-active-border-color: #047857;
    --bs-btn-disabled-bg: #10b981;
    --bs-btn-disabled-border-color: #10b981;

    /* Progress bar */
    --bs-progress-bar-bg: #10b981;
}

/* Primary button specific overrides */
.btn-primary {
    --bs-btn-bg: #10b981;
    --bs-btn-border-color: #10b981;
    --bs-btn-hover-bg: #059669;
    --bs-btn-hover-border-color: #059669;
    --bs-btn-active-bg: #047857;
    --bs-btn-active-border-color: #047857;
    --bs-btn-focus-shadow-rgb: 16, 185, 129;
    --bs-btn-disabled-bg: #10b981;
    --bs-btn-disabled-border-color: #10b981;
}

/* Outline primary button */
.btn-outline-primary {
    --bs-btn-color: #10b981;
    --bs-btn-border-color: #10b981;
    --bs-btn-hover-bg: #10b981;
    --bs-btn-hover-border-color: #10b981;
    --bs-btn-focus-shadow-rgb: 16, 185, 129;
    --bs-btn-active-bg: #10b981;
    --bs-btn-active-border-color: #10b981;
    --bs-btn-disabled-color: #10b981;
    --bs-btn-disabled-border-color: #10b981;
}

/* Text and link colors */
.text-primary {
    color: #10b981 !important;
}

a.text-primary:hover,
a.text-primary:focus {
    color: #059669 !important;
}

.link-primary {
    color: #10b981 !important;
}

.link-primary:hover,
.link-primary:focus {
    color: #059669 !important;
}

/* Background colors */
.bg-primary {
    background-color: #10b981 !important;
}

.bg-primary-subtle {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

/* Border colors */
.border-primary {
    border-color: #10b981 !important;
}

/* Form controls */
.form-control:focus,
.form-select:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
}

.form-check-input:checked {
    background-color: #10b981;
    border-color: #10b981;
}

.form-check-input:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
}

/* Badge */
.badge.text-bg-primary,
.badge.bg-primary {
    background-color: #10b981 !important;
}

/* Alert */
.alert-primary {
    color: #064e3b;
    background-color: #d1fae5;
    border-color: #a7f3d0;
}

/* Pagination */
.page-item.active .page-link {
    background-color: #10b981;
    border-color: #10b981;
}

.page-link {
    color: #10b981;
}

.page-link:hover {
    color: #059669;
}

/* Nav pills */
.nav-pills .nav-link.active {
    background-color: #10b981;
}

/* Spinner */
.spinner-border-primary {
    color: #10b981;
}

.spinner-grow-primary {
    color: #10b981;
}

/* Progress bar */
.progress-bar {
    background-color: #10b981;
}

/* Dark theme adjustments */
[data-bs-theme=dark] {
    /* Slightly lighter green for better visibility in dark mode */
    --bs-primary: #10b981;
    --bs-primary-rgb: 16, 185, 129;

    /* Adjust hover states for dark theme */
    --bs-btn-hover-bg: #059669;
    --bs-btn-hover-border-color: #059669;
    --bs-btn-active-bg: #047857;
    --bs-btn-active-border-color: #047857;
}

/* Date input styling to match search inputs */
.search-wrapper input[type="date"] {
    color: inherit;
    background-color: transparent;
}

.search-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

.search-wrapper input[type="date"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* Ensure date inputs match the search field styling */
.search-field input[type="date"].search-input {
    min-width: 150px;
}