.gradient-bg { 
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); 
}

.touch-btn {
    min-height: 44px;
    min-width: 44px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2563eb !important;
    border-top: 1px solid #3b82f6 !important;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}

.main-content {
    padding-bottom: 100px;
}

.task-category {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.seasonal-spring { 
    background: linear-gradient(135deg, #dcfce7, #bbf7d0); 
}

.seasonal-summer { 
    background: linear-gradient(135deg, #fef3c7, #fed7aa); 
}

.seasonal-fall { 
    background: linear-gradient(135deg, #fed7aa, #fdba74); 
}

.seasonal-winter { 
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe); 
}
/* Enhanced Dashboard Styles */

/* Interactive Stat Cards */
.stat-card {
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
}

.stat-card.active-filter {
    border-color: #0891b2;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    box-shadow: 0 8px 25px -5px rgb(8 145 178 / 0.2);
}

.stat-card.active-filter:hover {
    transform: translateY(-1px);
}

/* Enhanced Task Cards */
.enhanced-task-card {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.enhanced-task-card:hover {
    background-color: #f8fafc;
    border-left-color: #0891b2;
}

.enhanced-task-card.overdue {
    border-left-color: #ef4444;
    background-color: #fef2f2;
}

.enhanced-task-card.due-soon {
    border-left-color: #f59e0b;
    background-color: #fffbeb;
}

/* Filter UI Elements */
.filter-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    color: #6b7280;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.filter-btn.active {
    background: #0891b2;
    color: white;
    border-color: #0891b2;
}

/* Task Status Indicators */
.task-status-overdue {
    color: #dc2626;
    font-weight: 600;
}

.task-status-due-soon {
    color: #d97706;
    font-weight: 600;
}

.task-status-upcoming {
    color: #059669;
}

/* Priority Badges */
.priority-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.priority-high {
    background: #fee2e2;
    color: #991b1b;
}

.priority-medium {
    background: #fef3c7;
    color: #92400e;
}

.priority-low {
    background: #f3f4f6;
    color: #374151;
}

/* Category Badges */
.category-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.category-hvac { background: #fef3c7; color: #92400e; }
.category-water { background: #dcfce7; color: #166534; }
.category-exterior { background: #e0f2fe; color: #0c4a6e; }
.category-safety { background: #fee2e2; color: #991b1b; }
.category-general { background: #f3f4f6; color: #374151; }
.category-seasonal { background: #f3e8ff; color: #7c3aed; }

/* Task Action Buttons */
.task-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-action-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.task-action-complete {
    background: #dcfce7;
    color: #166534;
}

.task-action-complete:hover {
    background: #bbf7d0;
}

.task-action-reschedule {
    background: #dbeafe;
    color: #1e40af;
}

.task-action-reschedule:hover {
    background: #bfdbfe;
}

/* Enhanced Task Information Display */
.task-info-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
}

.task-meta-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.task-dates {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.due-date {
    font-weight: 600;
    font-size: 0.875rem;
}

.days-until {
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

.last-completed {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-message {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .task-info-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .task-dates {
        align-items: flex-start;
        text-align: left;
    }
    
    .task-actions {
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .task-meta-row {
        gap: 0.5rem;
    }
}

/* Accessibility */
.stat-card:focus,
.task-action-btn:focus,
.filter-btn:focus {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .stat-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .task-actions {
        display: none;
    }
    
    .filter-controls {
        display: none;
    }
}/* Mobile-First Responsive Improvements */

/* Better Mobile Stats Grid */
@media (max-width: 768px) {
    /* Single column stats on very small screens */
    @media (max-width: 480px) {
        .grid.grid-cols-2 {
            grid-template-columns: 1fr;
            gap: 1rem;
        }
    }
    
    /* Larger touch targets for stat cards */
    .stat-card {
        padding: 1rem;
        min-height: 80px;
    }
    
    .stat-card .text-xl {
        font-size: 1.5rem;
    }
    
    /* Better mobile dashboard padding */
    #dashboard-view {
        padding: 0.75rem;
    }
    
    /* Welcome card mobile optimization */
    .gradient-bg {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .gradient-bg h2 {
        font-size: 1.125rem;
    }
}

/* Remove the old single-row-task CSS completely */

/* Mobile Bottom Navigation */
@media (max-width: 768px) {
    .bottom-nav {
        padding-bottom: max(env(safe-area-inset-bottom), 1rem);
        box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
    }
    
    .tab-btn {
        padding: 1rem 0.5rem;
        min-height: 60px;
    }
    
    .tab-btn .text-lg {
        font-size: 1.25rem;
    }
    
    .tab-btn .text-xs {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
}

/* Mobile Modal Improvements */
@media (max-width: 768px) {
    .fixed.inset-0.flex {
        padding: 1rem;
        align-items: flex-end;
    }
    
    .fixed.inset-0.flex > div {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 1rem 1rem 0 0;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    /* Date picker modal mobile optimization */
    #date-picker-modal .bg-white {
        animation: slideUp 0.3s ease-out;
    }
    
    /* Task edit modal mobile optimization */
    #task-edit-modal .bg-white {
        animation: slideUp 0.3s ease-out;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Typography */
@media (max-width: 768px) {
    /* Slightly larger text for better readability */
    .text-xs {
        font-size: 0.8125rem;
    }
    
    .text-sm {
        font-size: 0.9375rem;
    }
    
    /* Better contrast for mobile */
    .text-gray-600 {
        color: #4b5563;
    }
    
    .text-gray-500 {
        color: #6b7280;
    }
}

/* Mobile Form Improvements */
@media (max-width: 768px) {
    /* Larger input fields for mobile */
    .form-input,
    input[type="date"],
    input[type="text"],
    input[type="number"],
    select,
    textarea {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    /* Better button sizing */
    .touch-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem 1rem;
    }
    
    /* Quick date buttons in date picker */
    .grid.grid-cols-2.gap-2 button {
        padding: 0.875rem;
        font-size: 0.9375rem;
    }
}

/* Mobile Calendar Improvements */
@media (max-width: 768px) {
    .calendar-container {
        margin: 0.5rem;
    }
    
    .calendar-day {
        min-height: 70px;
        padding: 0.5rem 0.25rem;
    }
    
    .calendar-day-header {
        padding: 0.75rem 0.25rem;
        font-size: 0.8125rem;
    }
    
    .day-number {
        font-size: 0.9375rem;
    }
    
    .selected-day-panel {
        max-height: 60vh;
    }
    
    .day-panel-task {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .task-actions {
        flex-direction: row;
    }
}

/* Mobile Accessibility */
@media (max-width: 768px) {
    /* Larger focus indicators for mobile */
    .stat-card:focus,
    .task-action-btn:focus,
    .touch-btn:focus {
        outline: 3px solid #0891b2;
        outline-offset: 2px;
    }
    
    /* Better contrast for mobile screens */
    .bg-white {
        background-color: #ffffff;
    }
    
    .shadow-lg {
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -2px rgb(0 0 0 / 0.1);
    }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .main-content {
        padding-bottom: 120px; /* More space for mobile nav */
    }
}

/* Mobile-specific animations */
@media (max-width: 768px) {
    .stat-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .task-action-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* Dark mode preparation for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    /* We can add dark mode later if needed */
}

/* Clean Mobile Task Card Rules */
@media (max-width: 768px) {
    .enhanced-task-card {
        padding: 0.75rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
    
    /* Force left alignment on mobile */
    .enhanced-task-card .flex.items-center {
        justify-content: flex-start !important;
        gap: 1rem !important;
    }
    
    /* Second row with due date and buttons */
    .enhanced-task-card .flex.items-center:last-child {
        justify-content: space-between !important;
    }
    
    /* Button styling to match calendar */
    .enhanced-task-card button {
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        padding: 0.5rem 0.75rem !important;
        min-height: 36px !important;
    }
}
/* Enhanced stat card hover effects */
.stat-card.active-filter {
    border-color: #0891b2;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    box-shadow: 0 8px 25px -5px rgb(8 145 178 / 0.2);
}

.stat-card:hover:not(.active-filter) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
}
/* Fix for new 2-row bottom navigation */
.main-content {
    padding-bottom: 140px; /* Increased from 100px to accommodate 2 rows */
}

@media (max-width: 768px) {
    .main-content {
        padding-bottom: 160px; /* More space on mobile */
    }
}

/* Secondary nav styling */
.bottom-nav .grid:last-child button {
    font-size: 0.75rem;
    padding: 0.5rem;
    min-height: 40px;
}
/* Mobile improvements for category headers with costs */
@media (max-width: 768px) {
    .flex.items-center.justify-between.flex-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .flex.items-center.justify-between.flex-wrap .text-right {
        align-self: flex-end;
    }
    
    .flex.items-center.justify-between.flex-wrap h3 {
        width: 100%;
    }
}
/* Settings Dropdown Styles */
#settings-dropdown {
    animation: slideDown 0.2s ease-out;
    transform-origin: top right;
}

#settings-dropdown.hidden {
    animation: slideUp 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* Simplified bottom nav with reduced padding */
.main-content {
    padding-bottom: 100px; /* Reduced from 140px */
}

@media (max-width: 768px) {
    .main-content {
        padding-bottom: 120px; /* Reduced from 160px */
    }
    
    /* Mobile settings dropdown adjustments */
    #settings-dropdown {
        right: -0.5rem;
        width: 12rem;
    }
}

/* Hide bottom nav during setup by default */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2563eb !important;
    border-top: 1px solid #3b82f6 !important;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
    display: none; /* Hidden by default */
}

/* Show bottom nav when main app is active */
body.main-app-active .bottom-nav {
    display: block;
}

/* Adjust main content padding only when nav is visible */
body.main-app-active .main-content {
    padding-bottom: 100px;
    padding-top: 0 !important;
}

.main-content {
    padding-bottom: 20px; /* Minimal padding during setup */
    padding-top: 0 !important;
}

@media (max-width: 768px) {
    body.main-app-active .main-content {
        padding-bottom: 120px;
    }
}

/* Mobile-optimized stat cards - STACKED LAYOUT */
@media (max-width: 768px) {
    .stat-card {
        padding: 1rem 0.75rem;
        min-height: 80px;
        text-align: center;
    }
    
    /* Hide icons on mobile for cleaner look */
    .stat-card .p-2 {
        display: none;
    }
    
    /* Stack the content vertically */
    .stat-card .flex.items-center.gap-3 {
        flex-direction: column;
        gap: 0.25rem;
        align-items: center;
    }
    
    /* Make numbers very prominent */
    .stat-card .text-xl {
        font-size: 2rem;
        font-weight: 800;
        line-height: 1;
        margin: 0;
    }
    
    /* Smaller label text */
    .stat-card .text-xs.text-gray-600 {
        font-size: 0.6875rem;
        line-height: 1;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.025em;
        margin: 0;
    }
    
    /* Color-code the numbers */
    .stat-card:first-child .text-xl {
        color: #ef4444; /* Red for overdue */
    }
    
    .stat-card:nth-child(2) .text-xl {
        color: #f59e0b; /* Orange for this week */
    }
    
    .stat-card:nth-child(3) .text-xl {
        color: #2563eb; /* Blue for all tasks */
    }
}
/* Show task descriptions on mobile in modals */
@media (max-width: 768px) {
    .task-description {
        display: block;
        font-size: 0.875rem;
        line-height: 1.4;
        margin-top: 0.5rem;
    }
}

/* Mobile dashboard spacing */
@media (max-width: 768px) {
    #dashboard-view {
        padding: 0.75rem;
    }
    
    #dashboard-view .mb-6 {
        margin-bottom: 1rem;
    }
    
    /* Tighter grid spacing */
    .grid.grid-cols-3.gap-4 {
        gap: 0.75rem;
    }
}

/* Completely hide the "Click to view" text */
.stat-card .text-xs.text-gray-500.mt-2 {
    display: none !important;
}

/* Also hide on mobile specifically */
@media (max-width: 768px) {
    .stat-card .text-xs.text-gray-500 {
        display: none !important;
    }
}

/* Make tasks list even tighter */
@media (max-width: 768px) {
    #tasks-list .border-b:last-child {
        border-bottom: none;
    }
    
    .bg-white.rounded-2xl.shadow-lg {
        border-radius: 12px;
    }
}


/* Mobile touch targets */
button, .btn, .touch-btn {
  min-height: 48px;
  min-width: 48px;
}
/* Prevent horizontal overflow on small screens */
html, body {
  overflow-x: hidden;
}
.container, .main-content {
  max-width: 100%;
}

/* Mobile Simple Task Cards */
@media (max-width: 768px) {
    .mobile-task-card-simple {
        padding: 0.75rem;
    }
    
    .mobile-task-card-simple .flex:first-child {
        margin-bottom: 0.5rem;
    }
    
    .mobile-task-card-simple button {
        min-height: 32px;
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .mobile-task-card-simple .truncate {
        min-width: 0;
    }
}

/* More spacing between task cards with priority styling */
.enhanced-task-card {
    margin-bottom: 0.75rem;
    border-bottom: none !important;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Default task cards */
.enhanced-task-card:not(.bg-red-50):not(.bg-orange-50):not(.bg-yellow-50) {
    border: 1px solid #e5e7eb;
}

/* Safety tasks (orange) */
.enhanced-task-card.bg-orange-50 {
    border: 1px solid #fb923c;
    box-shadow: 0 4px 6px rgba(251, 146, 60, 0.2);
}

/* Overdue tasks (red) */
.enhanced-task-card.bg-red-50 {
    border: 1px solid #f87171;
    box-shadow: 0 4px 6px rgba(248, 113, 113, 0.2);
}

/* Due soon tasks (yellow) */
.enhanced-task-card.bg-yellow-50 {
    border: 1px solid #fbbf24;
    box-shadow: 0 4px 6px rgba(251, 191, 36, 0.2);
}

/* Allow wrapping & keep left alignment in All Tasks view */
#all-tasks-view .truncate {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;
  text-align: left !important;
}

/* 📱 Mobile: start category lists collapsed with animation */
@media (max-width: 640px) {
  .category-task-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
  }

  .category-task-list.expanded {
    max-height: 1000px; /* Large enough to fit most lists */
    padding-top: 1rem;  /* Restore padding when open */
    padding-bottom: 1rem;
  }
}

/* 🖥 Desktop: always show category lists */

@media (max-width: 640px) {
  .category-task-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
  }
  .category-task-list.expanded {
    max-height: 1000px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}
