/* ============================================
   REPAIR DETAIL MODAL - Clean Style
   ============================================ */

.repair-detail-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    transition: opacity 0.3s ease !important;
    overflow: hidden !important;
    /* Prevent backdrop from scrolling */
    overscroll-behavior: contain !important;
}

.repair-detail-modal.active {
    opacity: 1 !important;
    pointer-events: all !important;
}

/* Modal Overlay */
.repair-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer !important;
    z-index: 1 !important;
}

/* White Content Card */
.repair-modal-content {
    position: relative !important;
    background: white !important;
    border-radius: 16px !important;
    max-width: 1400px !important;
    width: 95% !important;
    max-height: 90vh !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important;
    z-index: 10 !important;
    animation: modalSlideUp 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Navigation Arrows - Transparent with white icon */
.repair-nav-arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    cursor: pointer !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    opacity: 0.8 !important;
    pointer-events: auto !important;
    outline: none !important;
}

.repair-nav-arrow:hover {
    background: rgba(0, 0, 0, 0.5) !important;
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.1) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

.repair-nav-arrow:active {
    transform: translateY(-50%) scale(0.95) !important;
    background: rgba(0, 0, 0, 0.6) !important;
}

.repair-nav-arrow i,
.repair-nav-arrow svg {
    width: 28px !important;
    height: 28px !important;
    stroke-width: 3 !important;
}

.repair-nav-arrow.repair-nav-prev {
    left: 20px !important;
    right: auto !important;
}

.repair-nav-arrow.repair-nav-next {
    right: 20px !important;
    left: auto !important;
}

/* Mobile styles for arrows - position at top */
@media (max-width: 768px) {
    .repair-nav-arrow {
        /* Position at top of screen */
        position: fixed !important;
        top: 70px !important;
        bottom: auto !important;
        transform: none !important;
        width: 40px !important;
        height: 40px !important;
        z-index: 1001 !important;
        background: rgba(0, 0, 0, 0.6) !important;
        border-color: rgba(255, 255, 255, 0.9) !important;
    }

    .repair-nav-arrow:hover,
    .repair-nav-arrow:active {
        transform: scale(1.05) !important;
        background: rgba(0, 0, 0, 0.8) !important;
    }

    .repair-nav-arrow i,
    .repair-nav-arrow svg {
        width: 16px !important;
        height: 16px !important;
    }

    .repair-nav-arrow.repair-nav-prev {
        left: 12px !important;
        right: auto !important;
    }

    .repair-nav-arrow.repair-nav-next {
        right: 12px !important;
        left: auto !important;
    }
}

/* Close Button - Blue gradient matching cookie/privacy modals */
.repair-modal-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    border: none !important;
    color: white !important;
    font-size: 24px !important;
    cursor: pointer !important;
    z-index: 20 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

.repair-modal-close:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af) !important;
    transform: rotate(90deg) scale(1.05) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5) !important;
}

/* Modal Body - Two columns layout */
.repair-modal-body {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    flex: 1 !important;
    overflow: hidden !important;
    min-height: 0 !important;
    max-height: 100% !important;
}

/* Media Section */
.repair-modal-media {
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.repair-modal-media img,
.repair-modal-media video,
.repair-modal-media iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

.repair-modal-media video,
.repair-modal-media iframe {
    max-height: 90vh;
}

/* Force cover for Plyr videos in modal (non-fullscreen) */
/* Plyr wrapper should fill the container like iframe does */
.repair-modal-media .plyr,
.repair-modal-media .plyr--video {
    width: 100% !important;
    height: 100% !important;
}

/* Video element inside Plyr should use contain */
/* The object-fit property applies to BOTH the video playback AND the poster image */
.repair-modal-media .plyr video,
.repair-modal-media video.plyr-video,
.repair-modal-media .plyr--video video,
.repair-modal-media #repair-video-player,
.repair-detail-modal .repair-modal-media video {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
    object-position: center !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Ensure poster image displays with cover from the very first frame */
.repair-modal-media video[poster] {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Target the video element's internal poster rendering */
.repair-modal-media video::-webkit-media-controls,
.repair-modal-media video::-webkit-media-controls-enclosure {
    object-fit: cover !important;
}

/* Force Plyr wrapper to fill container immediately - prevents flash */
.repair-modal-media .plyr,
.repair-modal-media .plyr--video {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Force Plyr video wrapper to fill and use cover */
.repair-modal-media .plyr__video-wrapper {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Ensure Plyr poster uses cover immediately */
.repair-modal-media .plyr__poster {
    background-size: cover !important;
    background-position: center !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Force Plyr controls to be visible in modal */
.repair-modal-media .plyr__controls {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Remove focus outline from slider navigation buttons */
.repair-modal-nav {
    outline: none !important;
}

.repair-modal-nav:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Force Plyr controls wrapper to be visible */
.repair-modal-media .plyr__control {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.repair-modal-media .media-placeholder {
    font-size: 120px;
    opacity: 0.3;
}

/* Info Section */
.repair-modal-info {
    padding: 40px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 90vh;
}

.repair-modal-header {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.repair-modal-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin: 0;
    padding-right: 60px;
}

.repair-modal-badge {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.repair-modal-badge.popular {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.repair-modal-badge.warranty {
    background: linear-gradient(135deg, #10b981, #059669);
}

.repair-modal-badge.gaming {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.repair-modal-badge.critical {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Meta Info */
.repair-modal-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.meta-item svg {
    color: #3b82f6;
}

.meta-item span {
    color: #111827;
    font-weight: 500;
}

/* Description */
.repair-modal-description {
    margin-bottom: 32px;
}

.repair-modal-description h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.repair-modal-description p {
    font-size: 15px;
    line-height: 1.7;
    color: #4b5563;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    margin-bottom: 16px;
}

.repair-modal-description p:last-child {
    margin-bottom: 0;
}

/* Formatted lists (auto-generated from bullet points) */
.repair-modal-description .formatted-list {
    margin: 16px 0;
    padding-left: 24px;
}

.repair-modal-description .formatted-list li {
    font-size: 15px;
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 10px;
    padding-left: 8px;
}

.repair-modal-description .formatted-list li:last-child {
    margin-bottom: 0;
}

.repair-modal-description ul.formatted-list li {
    list-style-type: disc;
}

.repair-modal-description ol.formatted-list li {
    list-style-type: decimal;
}

.repair-modal-description ul.formatted-list li::marker {
    color: #3b82f6;
    font-size: 18px;
}

.repair-modal-description ol.formatted-list li::marker {
    color: #3b82f6;
    font-weight: 600;
}

/* Section headers (auto-detected) */
.repair-modal-description strong {
    font-weight: 600;
    color: #1f2937;
}

/* Inline icons in repair descriptions */
.repair-modal-description .inline-icon,
.repair-modal-info .inline-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin: 0 2px;
    flex-shrink: 0;
}

/* Actions */
.repair-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.repair-modal-actions a {
    flex: 1;
    min-width: 200px;
    padding: 14px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.repair-modal-actions a svg {
    display: block;
    flex-shrink: 0;
}

.repair-modal-actions .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.repair-modal-actions .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transition: left 0.4s ease;
    z-index: -1;
    border-radius: 30px;
}

.repair-modal-actions .btn-primary:hover::before {
    left: 0;
}

.repair-modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.repair-modal-actions .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.repair-modal-actions .btn-secondary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.repair-modal-actions .btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #059669, #047857);
    transition: left 0.4s ease;
    z-index: -1;
    border-radius: 30px;
}

.repair-modal-actions .btn-secondary:hover::before {
    left: 0;
}

.repair-modal-actions .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.repair-modal-actions .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {

    /* Make modal backdrop truly full screen with WHITE background */
    .repair-detail-modal {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        /* White background to eliminate grey bar */
        backdrop-filter: none !important;
    }

    .repair-modal-content {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        min-height: 100vh !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        background: white !important;
    }

    .repair-modal-body {
        grid-template-columns: 1fr !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        padding-bottom: 160px !important;
        /* Increased padding to ensure buttons visible on Chrome */
        background: white !important;
        /* Ensure background is white to cover bottom padding area */
        min-height: 100% !important;
        /* Ensure body fills entire content area */
    }

    /* Mobile: default to 100% to allow scrolling on Chrome */
    .repair-modal-content {
        height: 100% !important;
        min-height: 100% !important;
    }

    /* iOS/Safari only: extend height to fill address bar gap */
    @supports (-webkit-touch-callout: none) {
        .repair-modal-content {
            min-height: 110vh !important;
        }
    }

    .repair-modal-media {
        min-height: 200px !important;
        height: 200px !important;
        max-height: 200px !important;
        flex-shrink: 0 !important;
        position: relative !important;
    }

    .repair-modal-media img,
    .repair-modal-media video,
    .repair-modal-media iframe {
        height: 200px !important;
        object-fit: contain !important;
    }

    .repair-modal-info {
        padding: 20px !important;
        padding-bottom: 20px !important;
        /* Normal padding - margin on buttons handles spacing */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-height: none !important;
        flex: 1 !important;
        /* Allow to expand fully */
        flex-shrink: 0 !important;
        min-height: auto !important;
        background: white !important;
        /* Ensure white background extends to bottom */
    }

    .repair-modal-header h2 {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }

    .repair-modal-meta {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 16px !important;
        gap: 10px !important;
    }

    .meta-item {
        font-size: 13px !important;
    }

    /* Action buttons - HORIZONTAL, compact, minimal */
    .repair-modal-actions {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        background: transparent !important;
        padding: 8px 20px 20px 20px !important;
        margin: 12px 0 0 0 !important;
        /* Removed bottom margin - using body padding instead */
        box-shadow: none !important;
        z-index: 10 !important;
        border-top: 1px solid #e5e7eb !important;
        border-radius: 0 !important;
        gap: 8px !important;
        flex-direction: row !important;
        /* HORIZONTAL layout */
    }

    .repair-modal-actions a {
        min-width: auto !important;
        flex: 1 !important;
        /* Equal width */
        width: auto !important;
        padding: 10px 12px !important;
        /* Compact padding */
        font-size: 12px !important;
        /* Smaller text */
        font-weight: 600 !important;
        border-radius: 6px !important;
        /* Smaller radius */
        gap: 4px !important;
        /* Tight gap */
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
        white-space: nowrap !important;
        /* Prevent text wrapping */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .repair-modal-actions a svg {
        width: 14px !important;
        height: 14px !important;
        flex-shrink: 0 !important;
    }

    .repair-modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

/* Clickable Repair Styles */
.carousel-slide {
    cursor: pointer;
    transition: transform 0.2s;
}

.carousel-slide:hover {
    transform: scale(1.02);
}

.gallery-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

/* Prevent videos in cards from being clickable - only open modal */
.carousel-slide video,
.gallery-item video,
.modal-gallery-item video {
    pointer-events: none;
}

/* Also prevent iframes from intercepting clicks */
.carousel-slide iframe,
.gallery-item iframe,
.modal-gallery-item iframe {
    pointer-events: none;
}

/* Make modal gallery thumbnail images squared with consistent aspect ratio */
/* Carousel slides use their natural container size (landscape) */
.modal-gallery-item .modal-item-image img,
.modal-gallery-item .modal-item-image video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* Ensure carousel and other preview images also use object-fit cover */
.carousel-slide img,
.carousel-slide video,
.gallery-item img,
.gallery-item video {
    object-fit: cover !important;
    object-position: center !important;
}

/* ================================================
   FULLSCREEN VIDEO - MAINTAIN ASPECT RATIO
   Override cover with contain for fullscreen
   Works for both native controls and Plyr videos
   ================================================ */
video:fullscreen,
video:-webkit-full-screen,
video:-moz-full-screen,
video:-ms-fullscreen,
video.plyr-video:fullscreen,
video.plyr-video:-webkit-full-screen,
video.plyr-video:-moz-full-screen,
video.plyr-video:-ms-fullscreen,
.repair-modal-video:fullscreen,
.repair-modal-video:-webkit-full-screen,
.repair-modal-video:-moz-full-screen,
.repair-modal-video:-ms-fullscreen,
#repair-video-player:fullscreen,
#repair-video-player:-webkit-full-screen,
#repair-video-player:-moz-full-screen,
#repair-video-player:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
    background: #000 !important;
    aspect-ratio: auto !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
}

img:fullscreen,
img:-webkit-full-screen,
img:-moz-full-screen,
img:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
    background: #000 !important;
    aspect-ratio: auto !important;
}

/* ============================================
   STRUCTURED DESCRIPTION STYLES
   ============================================ */

.repair-modal-structured {
    margin-top: 24px;
}

.repair-modal-structured h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.structured-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0;
}

.structured-field i {
    flex-shrink: 0;
}

.structured-field strong {
    color: #374151;
    font-weight: 600;
    white-space: nowrap;
}

.structured-field .structured-value {
    color: #1f2937;
    flex: 1;
}

.structured-field-block {
    margin-bottom: 16px;
    padding: 0;
}

.structured-field-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.structured-field-header strong {
    color: #111827;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
}

.structured-field-block .structured-value {
    color: #1f2937;
    line-height: 1.6;
    margin: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .structured-field {
        flex-wrap: wrap;
    }

    .structured-field strong {
        white-space: normal;
    }
}