/* Custom styles for the application */

/* ===============================================
 * CRITICAL FIX: Override Tailwind's transparent background reset
 * 
 * Tailwind CSS sets `background-color: transparent` on ALL buttons/inputs
 * at line 483 of dashboard.css:
 *   button, input, select, optgroup, textarea { background-color: transparent; }
 * 
 * This breaks both default and hover backgrounds across the UI. The fixes 
 * below restore proper backgrounds using !important to override Tailwind's base layer.
 * =============================================== */

/* Default background colors (non-hover) */
.bg-blue-100 {
    background-color: #dbeafe !important;
}

.bg-blue-400 {
    background-color: #60a5fa !important;
}

.bg-blue-500 {
    background-color: #3b82f6 !important;
}

.bg-blue-600 {
    background-color: #2563eb !important;
}

/* Hover state for blue-500 */
.hover\:bg-blue-500:hover {
    background-color: #3b82f6 !important;
}

/* Hover state for blue-600 */
.hover\:bg-blue-600:hover {
    background-color: #2563eb !important;
}

.bg-blue-700 {
    background-color: #1d4ed8 !important;
}

.bg-purple-100 {
    background-color: #f3e8ff !important;
}

.bg-teal-100 {
    background-color: #ccfbf1 !important;
}

.bg-orange-100 {
    background-color: #ffedd5 !important;
}

.bg-gray-100 {
    background-color: #f3f4f6 !important;
}

.bg-gray-200 {
    background-color: #e5e7eb !important;
}

.bg-gray-800 {
    background-color: #1f2937 !important;
}

.bg-white {
    background-color: #ffffff !important;
}

/* Gray scale hover backgrounds */
.hover\:bg-gray-50:hover {
    background-color: #f9fafb !important;
}

.hover\:bg-gray-100:hover {
    background-color: #f3f4f6 !important;
}

.hover\:bg-gray-200:hover {
    background-color: #e5e7eb !important;
}

/* Blue hover backgrounds */
.hover\:bg-blue-50:hover {
    background-color: #eff6ff !important;
}

.hover\:bg-blue-100:hover {
    background-color: #dbeafe !important;
}

.hover\:bg-blue-600:hover {
    background-color: #2563eb !important;
}

.hover\:bg-blue-700:hover {
    background-color: #1d4ed8 !important;
}

/* Red hover backgrounds */
.hover\:bg-red-50:hover {
    background-color: #fef2f2 !important;
}

.hover\:bg-red-100:hover {
    background-color: #fee2e2 !important;
}

/* Green hover backgrounds */
.hover\:bg-green-50:hover {
    background-color: #f0fdf4 !important;
}

.hover\:bg-green-100:hover {
    background-color: #dcfce7 !important;
}

/* Yellow hover backgrounds */
.hover\:bg-yellow-50:hover {
    background-color: #fefce8 !important;
}

.hover\:bg-yellow-100:hover {
    background-color: #fef9c3 !important;
}

/* Purple hover backgrounds */
.hover\:bg-purple-50:hover {
    background-color: #faf5ff !important;
}

.hover\:bg-purple-100:hover {
    background-color: #f3e8ff !important;
}

/* Orange hover backgrounds */
.hover\:bg-orange-50:hover {
    background-color: #fff7ed !important;
}

.hover\:bg-orange-100:hover {
    background-color: #ffedd5 !important;
}

/* Custom mega menu hover backgrounds */
.analytics-category:hover {
    background-color: #f9fafb !important;
}

.analytics-link:hover {
    background-color: #eff6ff !important;
    color: #2563eb !important;
}

.analytics-menu-item:hover {
    background-color: #dbeafe !important;
}

/* Dark mode hover fixes */
.dark .hover\:bg-gray-700:hover {
    background-color: #374151 !important;
}

.dark .hover\:bg-gray-800:hover {
    background-color: #1f2937 !important;
}

.dark .hover\:bg-blue-900\/20:hover {
    background-color: rgba(30, 58, 138, 0.3) !important;
}

/* Base utility classes */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Custom button styles */
.btn-primary-custom {
    background-color: #60a5fa;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary-custom:hover {
    background-color: #2563eb;
}

.btn-secondary-custom {
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary-custom:hover {
    background-color: #e5e7eb;
}

/* Form styling */
.form-input-custom {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.form-input-custom:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Card styling */
.card-custom {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
}

/* Dashboard specific styles */
.dashboard-stat {
    text-align: center;
    padding: 1rem;
}

.dashboard-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
}

/* Dark mode overrides */
html.dark #budgetTable tbody tr {
    background-color: rgba(17, 24, 39, 0.72);
}

html.dark #budgetTable tbody tr:nth-child(odd) {
    background-color: rgba(17, 24, 39, 0.86);
}

html.dark #budgetTable thead {
    background-color: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
}

.dashboard-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Responsive utilities */
@media (max-width: 640px) {
    .container-custom {
        padding: 0 0.5rem;
    }

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