/**
 * VC Extensions PHP 8.2 Complete Patch - Styles
 * Version: 2.0.0
 */

/* ===================================
   MODAL STYLES
   =================================== */

.cq-modal-wrapper {
    display: inline-block;
}

.cq-modal-button {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.cq-modal-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cq-modal-button:active {
    transform: translateY(0);
}

.cq-modal-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: none;
}

.cq-modal-container.active {
    display: block !important;
}

.cq-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease;
}

.cq-modal-content {
    position: relative;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1000000;
    animation: slideDown 0.4s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cq-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 36px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    z-index: 1000001;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.cq-modal-close:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(90deg);
}

.cq-modal-body {
    padding: 50px 30px 30px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .cq-modal-content {
        width: 95% !important;
        margin: 20px auto !important;
        max-height: 90vh;
    }
    
    .cq-modal-body {
        padding: 40px 20px 20px;
    }
    
    .cq-modal-close {
        font-size: 28px;
        top: 10px;
        right: 15px;
    }
}

/* ===================================
   CAROUSEL STYLES
   =================================== */

.cq-carousel-wrapper {
    position: relative;
    margin: 30px auto;
    padding: 0;
}

.cq-carousel-slides {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
}

/* Carousel mode específico */
.cq-carousel-wrapper.cq-carousel-carousel .cq-carousel-slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 15px;
}

.cq-carousel-wrapper.cq-carousel-carousel .cq-carousel-slide {
    flex: 0 0 auto;
    width: calc(33.333% - 10px);
    scroll-snap-align: start;
}

.cq-carousel-slide {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.cq-carousel-slide:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.cq-carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.cq-carousel-slide:hover img {
    transform: scale(1.05);
}

.cq-carousel-link {
    display: block;
    text-decoration: none;
}

/* Navigation arrows */
.cq-carousel-prev,
.cq-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cq-carousel-prev:hover,
.cq-carousel-next:hover {
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.cq-carousel-prev {
    left: -25px;
}

.cq-carousel-next {
    right: -25px;
}

/* Dots navigation */
.cq-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.cq-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cq-carousel-dot:hover {
    background: #999;
}

.cq-carousel-dot.active {
    background: #333;
    width: 30px;
    border-radius: 6px;
}

/* Error message */
.cq-carousel-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    text-align: center;
}

/* Mobile responsiveness */
@media (max-width: 1024px) {
    .cq-carousel-wrapper.cq-carousel-carousel .cq-carousel-slide {
        width: calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .cq-carousel-slides {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cq-carousel-wrapper.cq-carousel-carousel .cq-carousel-slide {
        width: 85%;
    }
    
    .cq-carousel-prev,
    .cq-carousel-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .cq-carousel-prev {
        left: 5px;
    }
    
    .cq-carousel-next {
        right: 5px;
    }
}

/* Hide scrollbar but keep functionality */
.cq-carousel-wrapper.cq-carousel-carousel .cq-carousel-slides::-webkit-scrollbar {
    height: 8px;
}

.cq-carousel-wrapper.cq-carousel-carousel .cq-carousel-slides::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cq-carousel-wrapper.cq-carousel-carousel .cq-carousel-slides::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.cq-carousel-wrapper.cq-carousel-carousel .cq-carousel-slides::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===================================
   OTHER COMPONENTS (PLACEHOLDERS)
   =================================== */

.cq-beforeafter-placeholder,
.cq-custom-button,
.cq-hover-element,
.cq-hotspot-element {
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
    color: #6c757d;
    margin: 10px 0;
}

/* ===================================
   ACCESSIBILITY
   =================================== */

.cq-modal-button:focus,
.cq-modal-close:focus,
.cq-carousel-prev:focus,
.cq-carousel-next:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cq-modal-button,
    .cq-modal-overlay,
    .cq-modal-content,
    .cq-carousel-slide,
    .cq-carousel-slide img,
    .cq-carousel-prev,
    .cq-carousel-next,
    .cq-carousel-dot {
        animation: none;
        transition: none;
    }
}

/* Print styles */
@media print {
    .cq-modal-container,
    .cq-carousel-prev,
    .cq-carousel-next,
    .cq-carousel-dots {
        display: none !important;
    }
}

/* ===================================
   UTILITIES
   =================================== */

.cq-hidden {
    display: none !important;
}

.cq-visible {
    display: block !important;
}

/* Loading state */
.cq-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.cq-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}