/**
 * Rooferly Jobs Frontend Styles
 *
 * Modern, app-like styles for the frontend widgets and components.
 *
 * @package Rooferly_Jobs
 * @since 1.0.0
 */

/* CSS Custom Properties for theming */
:root {
    --rooferly-primary: #2563eb;
    --rooferly-primary-dark: #1d4ed8;
    --rooferly-secondary: #64748b;
    --rooferly-success: #10b981;
    --rooferly-warning: #f59e0b;
    --rooferly-danger: #ef4444;
    --rooferly-light: #f8fafc;
    --rooferly-dark: #1e293b;
    --rooferly-border: #e2e8f0;
    --rooferly-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --rooferly-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --rooferly-radius: 12px;
    --rooferly-radius-sm: 8px;
    --rooferly-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --rooferly-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Base styles */
.rooferly-stats-widget,
.rooferly-recent-jobs-widget,
.rooferly-jobs-widget,
.rooferly-map-widget {
    font-family: var(--rooferly-font-family);
    line-height: 1.6;
    color: var(--rooferly-dark);
    margin: 2rem 0;
}

/* ===== STATS WIDGET ===== */
.rooferly-stats-widget {
    background: transparent;
    border-radius: var(--rooferly-radius);
    padding: 0;
    box-shadow: none;
    position: relative;
    overflow: visible;
}

.rooferly-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.rooferly-stat-card {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-radius: var(--rooferly-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--rooferly-transition);
    border: 1px solid #e2e8f0 !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.rooferly-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rooferly-primary), var(--rooferly-success));
}

.rooferly-stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
}

.rooferly-stat-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.rooferly-stat-icon svg {
    width: 3rem;
    height: 3rem;
    color: var(--rooferly-primary);
    filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.2));
}

.rooferly-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rooferly-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b !important;
    line-height: 1;
    background: linear-gradient(135deg, var(--rooferly-primary), var(--rooferly-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rooferly-stat-label {
    font-size: 0.875rem;
    color: #64748b !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rooferly-stats-filters {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--rooferly-radius-sm);
    margin-top: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rooferly-stats-filters small {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
}

.rooferly-stats-empty {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--rooferly-radius-sm);
    margin-top: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rooferly-stats-empty p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

/* ===== RECENT JOBS WIDGET ===== */
.rooferly-recent-jobs-widget {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    border: none;
}

/* Recent Jobs Grid Layout (for card display) */
.rooferly-recent-jobs-grid {
    padding: 1rem 0;
}

.rooferly-recent-jobs-grid .rooferly-job-card {
    animation: rooferly-fade-in 0.6s ease-out;
    animation-fill-mode: both;
}

.rooferly-recent-jobs-grid .rooferly-job-card:nth-child(1) { animation-delay: 0.1s; }
.rooferly-recent-jobs-grid .rooferly-job-card:nth-child(2) { animation-delay: 0.2s; }
.rooferly-recent-jobs-grid .rooferly-job-card:nth-child(3) { animation-delay: 0.3s; }
.rooferly-recent-jobs-grid .rooferly-job-card:nth-child(4) { animation-delay: 0.4s; }
.rooferly-recent-jobs-grid .rooferly-job-card:nth-child(5) { animation-delay: 0.5s; }
.rooferly-recent-jobs-grid .rooferly-job-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive grid for Recent Jobs */
@media (max-width: 768px) {
    .rooferly-recent-jobs-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .rooferly-recent-jobs-grid {
        padding: 1rem;
        gap: 1rem !important;
    }
}


.rooferly-recent-jobs-list {
    padding: 0;
}

.rooferly-recent-job-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--rooferly-border);
    transition: var(--rooferly-transition);
    position: relative;
}

.rooferly-recent-job-item:last-child {
    border-bottom: none;
}

.rooferly-recent-job-item:hover {
    background: var(--rooferly-light);
    transform: translateX(4px);
}

.rooferly-recent-job-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--rooferly-primary);
    transform: scaleY(0);
    transition: var(--rooferly-transition);
}

.rooferly-recent-job-item:hover::before {
    transform: scaleY(1);
}

.rooferly-recent-job-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--rooferly-radius-sm);
    overflow: hidden;
    background: var(--rooferly-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rooferly-recent-job-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--rooferly-transition);
}

.rooferly-recent-job-item:hover .rooferly-recent-job-image img {
    transform: scale(1.1);
}

.rooferly-job-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--rooferly-light), #e2e8f0);
    color: var(--rooferly-secondary);
}

.rooferly-job-placeholder svg {
    width: 2rem;
    height: 2rem;
}

.rooferly-recent-job-details {
    flex: 1;
    min-width: 0;
}

.rooferly-recent-job-details h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--rooferly-dark);
    line-height: 1.3;
}

.rooferly-recent-job-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.rooferly-job-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--rooferly-secondary);
}

.rooferly-job-location svg {
    width: 1rem;
    height: 1rem;
    color: var(--rooferly-primary);
}

.rooferly-job-cost {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rooferly-success);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.rooferly-job-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rooferly-rating-stars {
    display: flex;
    gap: 0.125rem;
}

.star {
    font-size: 1rem;
    line-height: 1;
}

.star-filled {
    color: #fbbf24;
}

.star-half {
    color: #fbbf24;
    opacity: 0.7;
}

.star-empty {
    color: #d1d5db;
}

.rooferly-rating-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rooferly-secondary);
}

.rooferly-job-testimonial {
    font-size: 0.875rem;
    color: var(--rooferly-secondary);
    font-style: italic;
}

.rooferly-job-testimonial p {
    margin: 0 0 0.25rem 0;
}

.rooferly-job-testimonial cite {
    font-weight: 600;
    color: var(--rooferly-primary);
    font-style: normal;
}

/* ===== JOBS GRID WIDGET ===== */
.rooferly-jobs-widget {
    margin: 2rem 0;
}

.rooferly-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.rooferly-job-card {
    background: white;
    border-radius: var(--rooferly-radius);
    overflow: hidden;
    box-shadow: var(--rooferly-shadow);
    transition: var(--rooferly-transition);
    border: 1px solid var(--rooferly-border);
    position: relative;
}

.rooferly-job-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--rooferly-shadow-lg);
    border-color: var(--rooferly-primary);
}

.rooferly-job-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--rooferly-light);
}

.rooferly-job-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--rooferly-transition);
}

.rooferly-job-card:hover .rooferly-job-image img {
    transform: scale(1.1);
}

.rooferly-job-content {
    padding: 1.5rem;
}

.rooferly-job-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rooferly-dark);
    line-height: 1.3;
}

.rooferly-job-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--rooferly-secondary);
}

.rooferly-job-location svg {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--rooferly-primary);
}

.rooferly-job-category {
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: var(--rooferly-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    background: var(--rooferly-light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
}

.rooferly-job-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.rooferly-job-cost {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--rooferly-success);
    margin: 0;
    text-align: right;
}

/* ===== MAP WIDGET ===== */
.rooferly-map-widget {
    background: white;
    border-radius: var(--rooferly-radius);
    overflow: hidden;
    box-shadow: var(--rooferly-shadow);
    border: 1px solid var(--rooferly-border);
}

.rooferly-map {
    width: 100%;
    border-radius: var(--rooferly-radius);
}

/* Mapbox popup customization - Premium styling */
.mapboxgl-popup-content {
    border-radius: var(--rooferly-radius-lg) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid var(--rooferly-border) !important;
    padding: 1.5rem !important;
    font-family: var(--rooferly-font-family) !important;
    background: white !important;
    position: relative !important;
    overflow: visible !important;
    max-width: 300px !important;
    min-width: 250px !important;
}

/* Popup tip styling */
.mapboxgl-popup-tip {
    border-top-color: white !important;
    border-bottom-color: white !important;
}

.mapboxgl-popup-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--rooferly-dark);
}

.mapboxgl-popup-content p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--rooferly-secondary);
}

/* ===== MAPBOX POPUP CLOSE BUTTON - PREMIUM STYLING ===== */
.mapboxgl-popup-close-button {
    /* Reset default Mapbox styles */
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font: inherit !important;
    color: inherit !important;
    text-decoration: none !important;
    cursor: pointer !important;
    
    /* Premium positioning and sizing */
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    
    /* Modern design with glassmorphism */
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    
    /* Typography and icon */
    font-size: 18px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    color: var(--rooferly-text-muted) !important;
    
    /* Centering and alignment */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    
    /* Shadow and elevation */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    
    /* Ensure proper z-index */
    z-index: 1000 !important;
}

/* Hover state - Premium interaction */
.mapboxgl-popup-close-button:hover {
    background: rgba(255, 255, 255, 1) !important;
    color: var(--rooferly-primary) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--rooferly-primary) !important;
}

/* Focus state - Accessibility */
.mapboxgl-popup-close-button:focus {
    outline: none !important;
    background: rgba(255, 255, 255, 1) !important;
    color: var(--rooferly-primary) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
    border-color: var(--rooferly-primary) !important;
}

/* Active state - Click feedback */
.mapboxgl-popup-close-button:active {
    transform: scale(0.95) !important;
    background: rgba(59, 130, 246, 0.1) !important;
    color: var(--rooferly-primary) !important;
}

/* Mobile touch optimization */
@media (max-width: 768px) {
    .mapboxgl-popup-close-button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        font-size: 20px !important;
        top: 12px !important;
        right: 12px !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mapboxgl-popup-close-button {
        background: white !important;
        border: 2px solid var(--rooferly-text) !important;
        color: var(--rooferly-text) !important;
    }
    
    .mapboxgl-popup-close-button:hover {
        background: var(--rooferly-primary) !important;
        color: white !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mapboxgl-popup-close-button {
        transition: none !important;
    }
    
    .mapboxgl-popup-close-button:hover {
        transform: none !important;
    }
}

/* ===== FILTERS ===== */
.rooferly-jobs-filters {
    text-align: center;
    padding: 1rem;
    background: var(--rooferly-light);
    border-radius: var(--rooferly-radius-sm);
    border: 1px solid var(--rooferly-border);
    margin-top: 1.5rem;
}

.rooferly-jobs-filters small {
    color: var(--rooferly-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== EMPTY STATES ===== */
.rooferly-jobs-empty,
.rooferly-recent-jobs-widget.rooferly-empty,
.rooferly-map-empty {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: var(--rooferly-radius);
    border: 2px dashed var(--rooferly-border);
    color: var(--rooferly-secondary);
}

.rooferly-empty-state {
    max-width: 400px;
    margin: 0 auto;
}

.rooferly-empty-state svg {
    width: 4rem;
    height: 4rem;
    color: var(--rooferly-border);
    margin-bottom: 1rem;
}

.rooferly-empty-state p {
    margin: 0;
    font-size: 1rem;
    color: var(--rooferly-secondary);
}

/* ===== PHOTO CAROUSEL ===== */
.rooferly-photo-carousel {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--rooferly-radius-sm);
    background: var(--rooferly-light);
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    opacity: 1;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: none;
}

/* Remove the problematic hover scale effect that causes image overflow */
.rooferly-job-card:hover .carousel-slide img {
    transform: none;
}

/* Carousel Navigation - Force override any theme styles */
.rooferly-photo-carousel .carousel-nav,
.carousel-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    opacity: 0 !important;
    font-size: 16px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    backdrop-filter: blur(4px) !important;
}

.rooferly-photo-carousel:hover .carousel-nav {
    opacity: 1 !important;
}

.rooferly-photo-carousel .carousel-nav:hover,
.carousel-nav:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 1) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.rooferly-photo-carousel .carousel-nav:active,
.carousel-nav:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.rooferly-photo-carousel .carousel-nav.prev,
.carousel-nav.prev {
    left: 12px !important;
}

.rooferly-photo-carousel .carousel-nav.next,
.carousel-nav.next {
    right: 12px !important;
}

.rooferly-photo-carousel .carousel-nav:disabled,
.carousel-nav:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

.rooferly-photo-carousel .carousel-nav:disabled:hover,
.carousel-nav:disabled:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-50%) scale(1) !important;
}

/* Photo Counter */
.carousel-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rooferly-photo-carousel:hover .carousel-counter {
    opacity: 1;
}

/* Carousel Indicators (dots) - Force override any theme styles */
.rooferly-photo-carousel .carousel-indicators,
.carousel-indicators {
    position: absolute !important;
    bottom: 12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 8px !important;
    z-index: 10 !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
}

.rooferly-photo-carousel:hover .carousel-indicators {
    opacity: 1 !important;
}

.rooferly-photo-carousel .carousel-indicator,
.carousel-indicator {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: 1.5px solid rgba(255, 255, 255, 0.6) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(2px) !important;
}

.rooferly-photo-carousel .carousel-indicator.active,
.carousel-indicator.active {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 1) !important;
    transform: scale(1.1) !important;
}

.rooferly-photo-carousel .carousel-indicator:hover,
.carousel-indicator:hover {
    border-color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Touch/Swipe Support */
.carousel-track.dragging {
    transition: none;
}

.carousel-slide.dragging {
    user-select: none;
    pointer-events: none;
}

/* Fallback for single photo or no photos */
.rooferly-photo-carousel.single-photo .carousel-nav,
.rooferly-photo-carousel.single-photo .carousel-indicators,
.rooferly-photo-carousel.single-photo .carousel-counter {
    display: none;
}

/* ===== CAROUSEL LAYOUT ===== */
.rooferly-jobs-carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--rooferly-primary) var(--rooferly-light);
}

.rooferly-jobs-carousel::-webkit-scrollbar {
    height: 8px;
}

.rooferly-jobs-carousel::-webkit-scrollbar-track {
    background: var(--rooferly-light);
    border-radius: 4px;
}

.rooferly-jobs-carousel::-webkit-scrollbar-thumb {
    background: var(--rooferly-primary);
    border-radius: 4px;
}

.rooferly-jobs-carousel .rooferly-job-card {
    flex: 0 0 320px;
    scroll-snap-align: start;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .rooferly-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .rooferly-stat-card {
        padding: 1.5rem 1rem;
    }
    
    .rooferly-stat-number {
        font-size: 2rem;
    }
    
    .rooferly-stat-icon svg {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .rooferly-jobs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .rooferly-recent-job-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .rooferly-recent-job-image {
        align-self: center;
    }
    
    .rooferly-recent-job-meta {
        justify-content: center;
    }
    
    .rooferly-jobs-carousel {
        gap: 1rem;
    }
    
    .rooferly-jobs-carousel .rooferly-job-card {
        flex: 0 0 280px;
    }
}

@media (max-width: 480px) {
    .rooferly-stats-widget {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .rooferly-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .rooferly-stat-card {
        padding: 1.25rem 1rem;
    }
    
    .rooferly-recent-title {
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
    }
    
    .rooferly-recent-job-item {
        padding: 1rem 1.5rem;
    }
    
    .rooferly-job-content {
        padding: 1.25rem;
    }
    
    .rooferly-job-title {
        font-size: 1.125rem;
    }
    
    .rooferly-job-cost {
        font-size: 1.25rem;
    }
}

/* ===== DARK MODE SUPPORT - DISABLED ===== */
/* @media (prefers-color-scheme: dark) {
    :root {
        --rooferly-light: #1e293b;
        --rooferly-dark: #f1f5f9;
        --rooferly-border: #334155;
        --rooferly-secondary: #94a3b8;
    }
    
    .rooferly-job-card,
    .rooferly-recent-jobs-widget,
    .rooferly-map-widget {
        background: #0f172a;
        border-color: var(--rooferly-border);
    }
    
    .rooferly-stat-card {
        background: rgba(15, 23, 42, 0.95);
        border-color: var(--rooferly-border);
    }
    
    .rooferly-job-placeholder {
        background: linear-gradient(135deg, var(--rooferly-light), #334155);
    }
    
    .mapboxgl-popup-content {
        background: #0f172a;
        border-color: var(--rooferly-border);
        color: var(--rooferly-dark);
    }
} */

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .rooferly-job-card,
    .rooferly-stat-card,
    .rooferly-recent-job-item,
    .rooferly-job-image img {
        transition: none;
    }
    
    .rooferly-job-card:hover,
    .rooferly-stat-card:hover {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .rooferly-job-card,
    .rooferly-stat-card,
    .rooferly-recent-jobs-widget {
        border-width: 2px;
    }
    
    .rooferly-job-placeholder {
        border: 2px solid var(--rooferly-border);
    }
}

/* ===== LOADING STATES ===== */
.rooferly-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--rooferly-secondary);
}

.rooferly-loading::after {
    content: '';
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--rooferly-border);
    border-top-color: var(--rooferly-primary);
    border-radius: 50%;
    animation: rooferly-spin 1s linear infinite;
    margin-left: 1rem;
}

@keyframes rooferly-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== CASE STUDY MODAL ===== */
.rooferly-job-clickable {
    cursor: pointer;
    transition: var(--rooferly-transition);
}

.rooferly-job-clickable:hover {
    transform: translateY(-4px) scale(1.02);
}

/* Prevent body scroll when modal is open */
body.rooferly-modal-open {
    overflow: hidden;
}

/* Modal Overlay */
.rooferly-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rooferly-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.rooferly-modal {
    background: white;
    border-radius: var(--rooferly-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.rooferly-modal-overlay.active .rooferly-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.rooferly-modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid var(--rooferly-border);
    position: relative;
}

.rooferly-modal-close {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border: none !important;
    font-size: 1.5rem !important;
    color: white !important;
    cursor: pointer !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(4px) !important;
    z-index: 1000 !important;
    font-weight: normal !important;
    line-height: 1 !important;
}

.rooferly-modal-close:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    transform: scale(1.1) !important;
}

.rooferly-modal-close:active {
    transform: scale(0.95) !important;
}

.rooferly-modal-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--rooferly-dark);
    line-height: 1.3;
    padding-right: 3rem;
}

.rooferly-modal-subtitle {
    margin: 0;
    font-size: 1rem;
    color: var(--rooferly-secondary);
    font-weight: 500;
}

/* Modal Content */
.rooferly-modal-content {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    padding: 0;
}

/* Modal Body */
.rooferly-modal-body {
    padding: 2rem;
}

/* Case Study Sections */
.rooferly-case-study-section {
    margin-bottom: 2.5rem;
}

.rooferly-case-study-section:last-child {
    margin-bottom: 0;
}

.rooferly-case-study-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rooferly-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rooferly-case-study-section h3 svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--rooferly-primary);
}

/* Project Overview - Compact Two-Row Grid */
.rooferly-project-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

/* Top row - Most important info (Cost & Rating) */
.rooferly-overview-item:nth-child(1),
.rooferly-overview-item:nth-child(2) {
    grid-row: 1;
}

/* Bottom row - Timeline info (Start, End, Duration) */
.rooferly-overview-item:nth-child(3),
.rooferly-overview-item:nth-child(4),
.rooferly-overview-item:nth-child(5) {
    grid-row: 2;
    grid-column: span 1;
}

/* Make timeline items share the bottom row equally */
.rooferly-overview-item:nth-child(3) {
    grid-column: 1 / span 1;
}

.rooferly-overview-item:nth-child(4) {
    grid-column: 2 / span 1;
}

.rooferly-overview-item:nth-child(5) {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--rooferly-light), #f1f5f9);
    border: 1px dashed var(--rooferly-border);
}

.rooferly-overview-item {
    background: var(--rooferly-light);
    padding: 0.75rem;
    border-radius: var(--rooferly-radius-sm);
    text-align: center;
    border: 1px solid var(--rooferly-border);
    transition: var(--rooferly-transition);
}

.rooferly-overview-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--rooferly-shadow);
}

.rooferly-overview-label {
    font-size: 0.7rem;
    color: var(--rooferly-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
    line-height: 1.2;
}

.rooferly-overview-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--rooferly-dark);
    line-height: 1.2;
}

.rooferly-overview-value.cost {
    color: var(--rooferly-success);
    font-size: 1.25rem;
}

.rooferly-overview-value.rating {
    color: var(--rooferly-warning);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

/* Duration item special styling */
.rooferly-overview-item:nth-child(5) .rooferly-overview-value {
    font-size: 1rem;
    color: var(--rooferly-primary);
    font-weight: 600;
}

/* Photo Gallery */
.rooferly-modal-gallery {
    position: relative;
    height: 400px;
    border-radius: var(--rooferly-radius-sm);
    overflow: hidden;
    background: var(--rooferly-light);
    margin-bottom: 1.5rem;
}

.rooferly-modal-gallery-main {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.rooferly-modal-gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rooferly-modal-gallery-slide.active {
    opacity: 1;
}

.rooferly-modal-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery Navigation */
.rooferly-modal-gallery-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    width: 3rem !important;
    height: 3rem !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 1.25rem !important;
    color: white !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    backdrop-filter: blur(4px) !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

.rooferly-modal-gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    border-color: white !important;
    color: white !important;
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.rooferly-modal-gallery-nav:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.rooferly-modal-gallery-nav.prev {
    left: 1rem !important;
}

.rooferly-modal-gallery-nav.next {
    right: 1rem !important;
}

.rooferly-modal-gallery-nav:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.rooferly-modal-gallery-nav:disabled:hover {
    transform: translateY(-50%) scale(1) !important;
    box-shadow: none !important;
}

/* Gallery Thumbnails */
.rooferly-modal-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--rooferly-primary) var(--rooferly-light);
}

.rooferly-modal-gallery-thumbs::-webkit-scrollbar {
    height: 4px;
}

.rooferly-modal-gallery-thumbs::-webkit-scrollbar-track {
    background: var(--rooferly-light);
    border-radius: 2px;
}

.rooferly-modal-gallery-thumbs::-webkit-scrollbar-thumb {
    background: var(--rooferly-primary);
    border-radius: 2px;
}

.rooferly-modal-gallery-thumb {
    flex: 0 0 80px;
    height: 60px;
    border-radius: var(--rooferly-radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--rooferly-transition);
}

.rooferly-modal-gallery-thumb.active {
    border-color: var(--rooferly-primary);
}

.rooferly-modal-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Project Description */
.rooferly-project-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--rooferly-secondary);
    margin-bottom: 1.5rem;
}

/* Testimonial Section */
.rooferly-testimonial-section {
    background: var(--rooferly-light);
    padding: 2rem;
    border-radius: var(--rooferly-radius-sm);
    border-left: 4px solid var(--rooferly-primary);
    position: relative;
}

.rooferly-testimonial-quote {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--rooferly-dark);
    font-style: italic;
    margin-bottom: 1rem;
    position: relative;
}

.rooferly-testimonial-quote::before {
    content: '"';
    font-size: 3rem;
    color: var(--rooferly-primary);
    position: absolute;
    left: -1rem;
    top: -0.5rem;
    opacity: 0.3;
}

.rooferly-testimonial-author {
    font-weight: 600;
    color: var(--rooferly-primary);
    margin-bottom: 0.5rem;
}

.rooferly-testimonial-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile Responsive Modal */
@media (max-width: 768px) {
    .rooferly-modal-overlay {
        padding: 0.5rem !important;
        align-items: flex-start !important;
        padding-top: 1.5rem !important;
    }
    
    .rooferly-modal {
        max-width: 92vw !important;
        max-height: 88vh !important;
        margin: 0 !important;
        border-radius: var(--rooferly-radius-sm) !important;
    }
    
    .rooferly-modal-close {
        top: 0.75rem !important;
        right: 0.75rem !important;
        width: 3rem !important;
        height: 3rem !important;
        font-size: 1.75rem !important;
        background: rgba(0, 0, 0, 0.7) !important;
        z-index: 1001 !important;
    }
    
    .rooferly-modal-close:hover {
        background: rgba(0, 0, 0, 0.9) !important;
        transform: scale(1.05) !important;
    }
    
    .rooferly-modal-header {
        padding: 1.25rem 1.25rem 0.75rem 1.25rem !important;
    }
    
    .rooferly-modal-title {
        font-size: 1.375rem !important;
        padding-right: 3.5rem !important;
        line-height: 1.2 !important;
    }
    
    .rooferly-modal-subtitle {
        font-size: 0.9rem !important;
    }
    
    .rooferly-modal-content {
        max-height: calc(88vh - 90px) !important;
        padding-bottom: 1rem !important;
    }
    
    .rooferly-modal-body {
        padding: 1.25rem 1.25rem 2rem 1.25rem !important;
    }
    
    .rooferly-project-overview {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 0.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Mobile: Keep cost and rating in top row, dates in second row */
    .rooferly-overview-item:nth-child(1),
    .rooferly-overview-item:nth-child(2) {
        grid-row: 1 !important;
        grid-column: span 1 !important;
    }
    
    .rooferly-overview-item:nth-child(3),
    .rooferly-overview-item:nth-child(4) {
        grid-row: 2 !important;
        grid-column: span 1 !important;
    }
    
    .rooferly-overview-item:nth-child(5) {
        grid-row: 3 !important;
        grid-column: 1 / -1 !important;
    }
    
    .rooferly-overview-item {
        padding: 0.625rem !important;
    }
    
    .rooferly-overview-label {
        font-size: 0.65rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .rooferly-overview-value {
        font-size: 1rem !important;
    }
    
    .rooferly-overview-value.cost {
        font-size: 1.125rem !important;
    }
    
    .rooferly-modal-gallery {
        height: 200px !important;
        margin-bottom: 1rem !important;
    }
    
    .rooferly-modal-gallery-nav {
        width: 2.5rem !important;
        height: 2.5rem !important;
        font-size: 1.125rem !important;
    }
    
    .rooferly-modal-gallery-nav.prev {
        left: 0.75rem !important;
    }
    
    .rooferly-modal-gallery-nav.next {
        right: 0.75rem !important;
    }
    
    .rooferly-case-study-section {
        margin-bottom: 1.5rem !important;
    }
    
    .rooferly-case-study-section h3 {
        font-size: 1.125rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .rooferly-testimonial-section {
        padding: 1.25rem !important;
    }
    
    .rooferly-testimonial-quote {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }
    
    .rooferly-modal-gallery-thumbs {
        padding: 0.75rem 0 !important;
        gap: 0.375rem !important;
    }
    
    .rooferly-modal-gallery-thumb {
        flex: 0 0 70px !important;
        height: 50px !important;
    }
    
    /* Fix project description text cutoff */
    .rooferly-project-description {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.5rem !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
}

@media (max-width: 480px) {
    .rooferly-modal-overlay {
        padding: 0.25rem !important;
        padding-top: 0.75rem !important;
    }
    
    .rooferly-modal {
        max-width: 96vw !important;
        max-height: 92vh !important;
        border-radius: var(--rooferly-radius-sm) !important;
    }
    
    .rooferly-modal-close {
        top: 0.5rem !important;
        right: 0.5rem !important;
        width: 2.75rem !important;
        height: 2.75rem !important;
        font-size: 1.5rem !important;
    }
    
    .rooferly-modal-header {
        padding: 1rem 1rem 0.5rem 1rem !important;
    }
    
    .rooferly-modal-title {
        font-size: 1.25rem !important;
        padding-right: 3rem !important;
    }
    
    .rooferly-modal-subtitle {
        font-size: 0.875rem !important;
    }
    
    .rooferly-modal-content {
        max-height: calc(92vh - 70px) !important;
        padding-bottom: 1rem !important;
    }
    
    .rooferly-modal-body {
        padding: 1rem 1rem 2rem 1rem !important;
    }
    
    .rooferly-project-overview {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 0.5rem !important;
    }
    
    /* Small mobile: Keep cost and rating on top row */
    .rooferly-overview-item:nth-child(1),
    .rooferly-overview-item:nth-child(2) {
        grid-row: 1 !important;
        grid-column: span 1 !important;
    }
    
    /* Dates in second row */
    .rooferly-overview-item:nth-child(3),
    .rooferly-overview-item:nth-child(4) {
        grid-row: 2 !important;
        grid-column: span 1 !important;
    }
    
    /* Duration spans full width in third row */
    .rooferly-overview-item:nth-child(5) {
        grid-row: 3 !important;
        grid-column: 1 / -1 !important;
    }
    
    .rooferly-overview-item {
        padding: 0.5rem !important;
    }
    
    .rooferly-overview-label {
        font-size: 0.6rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .rooferly-overview-value {
        font-size: 0.9rem !important;
    }
    
    .rooferly-overview-value.cost {
        font-size: 1rem !important;
    }
    
    .rooferly-modal-gallery {
        height: 160px !important;
        margin-bottom: 1rem !important;
    }
    
    .rooferly-modal-gallery-nav {
        width: 2.25rem !important;
        height: 2.25rem !important;
        font-size: 1rem !important;
    }
    
    .rooferly-modal-gallery-nav.prev {
        left: 0.5rem !important;
    }
    
    .rooferly-modal-gallery-nav.next {
        right: 0.5rem !important;
    }
    
    .rooferly-case-study-section {
        margin-bottom: 1.25rem !important;
    }
    
    .rooferly-case-study-section h3 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .rooferly-testimonial-section {
        padding: 1rem !important;
    }
    
    .rooferly-testimonial-quote {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
    
    .rooferly-modal-gallery-thumbs {
        padding: 0.5rem 0 !important;
        gap: 0.25rem !important;
    }
    
    .rooferly-modal-gallery-thumb {
        flex: 0 0 60px !important;
        height: 45px !important;
    }
    
    /* Fix project description text cutoff on small mobile */
    .rooferly-project-description {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1.25rem !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
}

/* Additional mobile improvements */
@media (max-width: 768px) {
    /* Improve touch targets */
    .rooferly-modal-gallery-thumb {
        border-width: 3px !important;
    }
    
    /* Better scrolling on mobile */
    .rooferly-modal-content {
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
    }
    
    /* Optimize text readability */
    .rooferly-project-description {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
}

/* Landscape orientation optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .rooferly-modal {
        max-height: 95vh !important;
    }
    
    .rooferly-modal-content {
        max-height: calc(95vh - 80px) !important;
    }
    
    .rooferly-modal-gallery {
        height: 160px !important;
    }
    
    .rooferly-project-overview {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes rooferly-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rooferly-stats-widget,
.rooferly-recent-jobs-widget,
.rooferly-jobs-widget,
.rooferly-map-widget {
    animation: rooferly-fade-in 0.6s ease-out;
}

.rooferly-job-card {
    animation: rooferly-fade-in 0.6s ease-out;
    animation-fill-mode: both;
}

.rooferly-job-card:nth-child(1) { animation-delay: 0.1s; }
.rooferly-job-card:nth-child(2) { animation-delay: 0.2s; }
.rooferly-job-card:nth-child(3) { animation-delay: 0.3s; }
.rooferly-job-card:nth-child(4) { animation-delay: 0.4s; }
.rooferly-job-card:nth-child(5) { animation-delay: 0.5s; }
.rooferly-job-card:nth-child(6) { animation-delay: 0.6s; }
