/* ==========================================================================
   Service Hero Section Styles - Shared between services.html and home.html
   ========================================================================== */

/* CSS Variables for gradient effects */
:root {
    --primary-color-rgb: 255, 140, 0; /* Orange primary color - fallback */
    --accent-color-rgb: 0, 123, 255; /* Blue accent color - fallback */
    --shadow-light: color-mix(in srgb, var(--font-color) 2%, rgba(0, 0, 0, 0.01));
    --shadow-normal: color-mix(in srgb, var(--font-color) 4%, rgba(0, 0, 0, 0.04));
    --shadow-intense: color-mix(in srgb, var(--font-color) 8%, rgba(0, 0, 0, 0.08));
}

/* Service Hero Section Styling */
.service-hero-section {
    position: relative;
    transition: all 0.3s ease;
    min-height: 400px;
    display: flex;
    align-items: flex-start;
    padding: 5rem 0 !important; /* Increased vertical padding */
    overflow-x: hidden; /* Prevent horizontal overflow */
    width: 100%;
    max-width: 100vw; /* Ensure section doesn't exceed viewport width */
}

.service-hero-section:nth-child(even) {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%) !important;
    position: relative;
}

/* Only apply gradient overlay when no custom background color is set */
.service-hero-section:nth-child(even):not([style*="background-color"])::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        color-mix(in srgb, var(--accent-color) 1%, white) 0%, 
        color-mix(in srgb, var(--accent-color) 2%, white) 50%, 
        color-mix(in srgb, var(--accent-color) 1%, white) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Remove default background when custom background is applied */
.service-hero-section[style*="background-color"] {
    background: none !important;
}

.service-hero-section:nth-child(even) .container {
    position: relative;
    z-index: 2;
}

.service-hero-section:nth-child(odd) {
    background: #ffffff !important;
}

/* Service Image Container */
.service-image-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--card-border-radius);
    border: 1px solid #e9ecef;
    transition: all 0.2s ease-in-out;
}

.service-image-container.clickable {
    cursor: pointer;
}

.service-image-container.clickable:hover {
    box-shadow: 0 8px 25px var(--shadow-normal);
}

.service-image {
    transition: all 0.3s ease;
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.service-image:hover {
    transform: scale(1.05);
}

.service-image-top {
    max-width: 700px;
    height: 350px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.service-image-top:hover {
    transform: scale(1.05);
}

.service-image-bottom {
    max-width: 700px;
    height: 350px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.service-image-bottom:hover {
    transform: scale(1.05);
}

/* Placeholder Image Styling */
.service-placeholder-image {
    width: 100%;
    height: 300px;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: white;
}

.service-placeholder-image:hover {
    transform: scale(1.05);
}

.service-placeholder-image-top {
    width: 600px;
    height: 300px;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: white;
}

.service-placeholder-image-top:hover {
    transform: scale(1.05);
}

.service-placeholder-image-bottom {
    width: 600px;
    height: 300px;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: white;
}

.service-placeholder-image-bottom:hover {
    transform: scale(1.05);
}

/* Edit Overlay for Services */
.service-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--card-border-radius);
}

.service-image-container:hover .service-edit-overlay {
    opacity: 1;
}

.service-edit-overlay .edit-controls {
    display: flex;
    gap: 10px;
}

/* Section-wide Edit Overlay for Services */
.service-section-edit-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto;
    bottom: auto;
    background: none;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
    pointer-events: none;
}

.service-hero-section:hover .service-section-edit-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Always show edit controls on touch devices in edit mode */
@media (hover: none) and (pointer: coarse) {
    .service-section-edit-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

.service-section-edit-overlay .edit-controls {
    pointer-events: auto;
    z-index: 101;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px;
    box-shadow: var(--shadow-light);
}

.service-section-edit-overlay .edit-controls > div {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Reorder button styling */
.service-section-edit-overlay .btn-group {
    background: transparent;
    border-radius: 6px;
    box-shadow: none;
}

.service-section-edit-overlay .btn-group .btn {
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    padding: 8px 12px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.service-section-edit-overlay .btn-group .btn:hover {
    background: #f8f9fa;
    color: #495057;
    transform: none;
    border-color: #adb5bd;
}

.service-section-edit-overlay .btn-group .btn:first-child {
    border-right: 1px solid #dee2e6;
}

.service-section-edit-overlay .btn-group .btn i {
    font-size: 1rem;
}

/* Edit button styling */
.service-section-edit-overlay .btn-edit-mode {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: #ff8c00;
    border-color: #ff8c00;
    color: white;
}

.service-section-edit-overlay .btn-edit-mode:hover {
    background: #ff6600;
    border-color: #ff6600;
    color: white;
    transform: none;
}

/* Service Content Styling */
.service-content h2 {
    color: var(--font-color);
    font-weight: 600;
}

.service-content .lead {
    color: #6c757d;
    line-height: 1.5;
    font-size: 1.1rem;
}

/* Content width constraints for image top/bottom layouts */
.service-content.text-center {
    max-width: 600px;
    min-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.service-content.text-center .features-list {
    max-width: 350px;
    min-width: 350px;
    background-color: color-mix(in srgb, var(--accent-color) 5%, transparent);
    padding: 15px 20px;
    margin-left: auto;
    margin-right: auto;
}

/* Price Tag Styling */
.price-tag .badge {
    font-size: 1rem !important;
    padding: 0.5rem 1rem;
    font-weight: 500;
    border: 2px solid var(--primary-color);
    background-color: white !important;
    white-space: nowrap;
}

.price-tag {
    flex-shrink: 0;
}

/* Features List Styling */
.features-list {
    /* background: #fff;
    border: 1px solid #e9ecef; */
    border-radius: 12px;
    /* padding: 20px 25px; */
    padding-bottom: 10px;
}

.features-list ul {
    margin-bottom: 0;
}

.features-list li {
    margin-bottom: 12px;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.5;
}

.features-list li:last-child {
    margin-bottom: 0;
}

.features-list li i {
    color: #28a745;
    margin-right: 8px;
    font-size: 0.9rem;
}

/* Empty State Styling */
.empty-state {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 50px 20px !important;
    padding-bottom: 30px !important;
    border: 2px dashed #dee2e6;
}

/* Tablet-specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .service-image-top,
    .service-placeholder-image-top,
    .service-image-bottom,
    .service-placeholder-image-bottom {
        max-width: 500px;
        height: auto;
        min-height: 280px;
        max-height: 320px;
    }
    
    .service-image-top,
    .service-image-bottom {
        object-fit: cover;
        aspect-ratio: 16/10;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .service-hero-section {
        min-height: auto;
        padding: 4.5rem 0 !important; /* Increased vertical padding for mobile */
    }
    
    /* Standardize ALL service images on mobile - consistent height and aspect ratio */
    .service-image,
    .service-placeholder-image,
    .service-image-top,
    .service-placeholder-image-top,
    .service-image-bottom,
    .service-placeholder-image-bottom {
        width: 100%;
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
        object-fit: cover;
        aspect-ratio: 16/9;
        border-radius: var(--card-border-radius);
    }
    
    /* Ensure placeholder images have consistent background */
    .service-placeholder-image,
    .service-placeholder-image-top,
    .service-placeholder-image-bottom {
        background-color: white;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* .features-list {
        margin-bottom: 2rem;
    } */
    
    .col-lg-6.order-lg-2 {
        order: 1 !important;
    }
    
    .col-lg-6.order-lg-1 {
        order: 2 !important;
    }
    
    /* Reduce gap between image and content on mobile */
    .row.align-items-start.g-5 {
        gap: 0rem !important; /* Further reduced gap */
    }
    
    .col-lg-6.mb-4.mb-lg-0 {
        margin-bottom: 0rem !important; /* Further reduced gap below image */
    }
    
    /* Additional spacing adjustments for mobile */
    .service-hero-section .container .row {
        row-gap: 0rem !important;
    }
    
    /* Keep title and price side by side on mobile */
    .d-flex.align-items-center.justify-content-between {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .d-flex.align-items-center.justify-content-between h2 {
        margin-bottom: 0;
        flex: 1;
        min-width: 0; /* Allow text to wrap if needed */
    }
    
    .price-tag {
        flex-shrink: 0;
    }
    
    /* Standardize image containers on mobile */
    .service-image-container {
        width: 100%;
        height: 220px;
        overflow: hidden;
        border-radius: var(--card-border-radius);
        border: 1px solid #e9ecef;
        margin-bottom: 1rem;
    }
    
    /* Mobile adjustments for content width constraints */
    .service-content.text-center {
        max-width: 100%;
        min-width: 100%;
        padding: 0 15px;
        text-align: left !important;
    }
    
    .service-content.text-center .features-list {
        max-width: 100%;
        min-width: 100%;
        /* margin: 15px auto;
        padding: 15px 20px; */
    }
}

/* Edit Mode Specific Styles */
.edit-mode .service-hero-section:hover {
    background: color-mix(in srgb, var(--accent-color) 2%, transparent) !important;
    border-left: 4px solid var(--accent-color);
}
