/* Main Description Pro - Device-Specific Accordion Styling */

/* Main wrapper */
.cew-main-description-wrapper {
    position: relative;
}

/* Desktop device styles */
.cew-desktop-device .main-description-content {
    position: relative;
    line-height: 1.6em;
    transition: max-height 0.4s ease;
    overflow: hidden;
}

/* Mobile device styles */
.cew-mobile-device .main-description-content {
    position: relative;
    line-height: 1.5em;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

/* Accordion title - clickable */
.cew-accordion-title {
    cursor: pointer;
    position: relative;
    padding-right: 40px;
    transition: color 0.3s ease;
}

.cew-accordion-title:hover {
    color: #667eea;
}

/* Accordion button styles */
.cew-accordion-button {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border: none !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    text-align: center;
}

.cew-accordion-button:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4195 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cew-accordion-button:active {
    transform: translateY(0);
}

/* Icon styles */
.cew-accordion-icon {
    display: inline-block;
    margin-right: 8px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.cew-accordion-button.collapsed .cew-accordion-icon {
    transform: rotate(0deg);
}

.cew-accordion-button.expanded .cew-accordion-icon {
    transform: rotate(180deg);
}

/* Fade effect when collapsed */
.cew-main-description-wrapper.collapsed .main-description-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
    z-index: 1;
}

/* Expanded state */
.cew-main-description-wrapper.expanded .main-description-content {
    max-height: 5000px !important;
}

.cew-main-description-wrapper.expanded .main-description-content::after {
    opacity: 0;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .cew-accordion-button {
        width: 100%;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .cew-accordion-title {
        padding-right: 35px;
        font-size: 18px;
    }
    
    .cew-mobile-device .main-description-content {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cew-accordion-button {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .cew-accordion-title {
        font-size: 16px;
    }
}

/* Desktop accordion support */
@media (min-width: 769px) {
    .cew-desktop-device .cew-accordion-button {
        display: inline-block;
        width: auto;
        min-width: 150px;
    }
    
    .cew-desktop-device .main-description-content {
        font-size: 15px;
    }
}

/* Real device hiding for frontend */
.cew-hide-mobile,
.cew-hide-desktop {
    display: none !important;
}

/* Mobile phones (≤480px) - show mobile widgets, hide desktop */
@media (max-width: 480px) {
    .cew-hide-mobile {
        display: block !important;
    }
    .cew-hide-desktop {
        display: none !important;
    }
}

/* Tablets (481px - 768px) - show mobile widgets, hide desktop */
@media (min-width: 481px) and (max-width: 768px) {
    .cew-hide-mobile {
        display: block !important;
    }
    .cew-hide-desktop {
        display: none !important;
    }
}

/* Desktop (≥769px) - show desktop widgets, hide mobile */
@media (min-width: 769px) {
    .cew-hide-desktop {
        display: block !important;
    }
    .cew-hide-mobile {
        display: none !important;
    }
}

/* Elementor preview override - show all for editing */
body.elementor-editor-active .cew-hide-mobile,
body.elementor-editor-active .cew-hide-desktop {
    display: block !important;
}

/* Smooth transitions */
.cew-main-description-wrapper .main-description-content {
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overflow: hidden;
    position: relative;
}

.cew-main-description-wrapper .main-description-content.cew-transitioning {
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Fade effect improvements */
.cew-main-description-wrapper.collapsed .main-description-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5em;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,1) 100%);
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.cew-main-description-wrapper.expanded .main-description-content::after {
    opacity: 0;
}

/* Better button animations */
.cew-accordion-button {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border: none !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cew-accordion-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.cew-accordion-button:hover::before {
    left: 100%;
}

.cew-accordion-button:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4195 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.cew-accordion-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Loading state */
.cew-main-description-wrapper.loading .main-description-content {
    opacity: 0.7;
}

/* Accessibility */
.cew-accordion-title:focus,
.cew-accordion-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
