/**
 * Product Highlights Widget Styles
 * Modern, premium design with tree structure support
 */

/* ================================
   BASE CONTAINER STYLES
   ================================ */
.woolements-product-highlights {
    --ph-primary-color: #3b82f6;
    --ph-secondary-color: #64748b;
    --ph-success-color: #10b981;
    --ph-bg-color: #ffffff;
    --ph-border-color: #e2e8f0;
    --ph-text-color: #1e293b;
    --ph-text-muted: #64748b;
    --ph-transition-duration: 300ms;
    --ph-border-radius: 12px;
    --ph-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    font-family: inherit;
    direction: rtl;
}

.woolements-product-highlights * {
    box-sizing: border-box;
}

/* ================================
   GROUP STYLES
   ================================ */
.woolements-ph-group {
    background: var(--ph-bg-color);
    border-radius: var(--ph-border-radius);
    margin-bottom: 16px;
    box-shadow: var(--ph-shadow);
    overflow: hidden;
    transition: box-shadow var(--ph-transition-duration) ease;
}

.woolements-ph-group:last-child {
    margin-bottom: 0;
}

.woolements-ph-group:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ================================
   GROUP HEADER STYLES
   ================================ */
.woolements-ph-group-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    user-select: none;
    transition: all var(--ph-transition-duration) ease;
    gap: 12px;
}

.woolements-ph-collapsible .woolements-ph-group-header:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.woolements-ph-group-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--ph-primary-color) 0%, #2563eb 100%);
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    transition: transform var(--ph-transition-duration) ease;
}

.woolements-ph-group-header:hover .woolements-ph-group-icon {
    transform: scale(1.05);
}

.woolements-ph-group-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

.woolements-ph-group-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--ph-text-color);
    line-height: 1.4;
}

/* Toggle Icons */
.woolements-ph-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--ph-secondary-color);
    font-size: 12px;
    transition: all var(--ph-transition-duration) ease;
}

.woolements-ph-group-header:hover .woolements-ph-toggle-icon {
    background: rgba(0, 0, 0, 0.1);
    color: var(--ph-text-color);
}

.woolements-ph-toggle-collapsed {
    display: none;
}

.woolements-ph-toggle-expanded {
    display: flex;
}

.woolements-ph-group:not(.woolements-ph-expanded) .woolements-ph-toggle-collapsed {
    display: flex;
}

.woolements-ph-group:not(.woolements-ph-expanded) .woolements-ph-toggle-expanded {
    display: none;
}

/* ================================
   GROUP CONTENT STYLES
   ================================ */
.woolements-ph-group-content {
    position: relative;
    padding: 16px 20px;
    overflow: hidden;
    transition: all var(--ph-transition-duration) ease;
}

.woolements-ph-group:not(.woolements-ph-expanded) .woolements-ph-group-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.woolements-ph-expanded .woolements-ph-group-content {
    max-height: 2000px;
    opacity: 1;
}

/* Animation for expand/collapse */
.woolements-ph-animated .woolements-ph-group-content {
    transition: max-height var(--ph-transition-duration) ease-in-out, 
                padding var(--ph-transition-duration) ease-in-out,
                opacity var(--ph-transition-duration) ease-in-out;
}

/* ================================
   FEATURES LIST STYLES
   ================================ */
.woolements-ph-features-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ================================
   FEATURE ITEM STYLES
   ================================ */
.woolements-ph-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all var(--ph-transition-duration) ease;
    position: relative;
}

.woolements-ph-feature-item:hover {
    background: #ffffff;
    border-color: var(--ph-border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Hover Animations */
.woolements-ph-hover-lift .woolements-ph-feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.woolements-ph-hover-scale .woolements-ph-feature-item:hover {
    transform: scale(1.02);
}

.woolements-ph-hover-glow .woolements-ph-feature-item:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
    border-color: var(--ph-primary-color);
}

/* Feature Icon */
.woolements-ph-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--ph-success-color) 0%, #059669 100%);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    flex-shrink: 0;
    transition: transform var(--ph-transition-duration) ease;
}

.woolements-ph-feature-item:hover .woolements-ph-feature-icon {
    transform: scale(1.1);
}

.woolements-ph-feature-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 3px;
}

/* Feature Content */
.woolements-ph-feature-content {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.woolements-ph-feature-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ph-text-color);
    line-height: 1.5;
}

.woolements-ph-feature-separator {
    color: var(--ph-text-muted);
    font-weight: 400;
}

.woolements-ph-feature-value {
    font-size: 14px;
    font-weight: 400;
    color: var(--ph-text-muted);
    line-height: 1.5;
}

/* ================================
   LAYOUT VARIANTS
   ================================ */

/* Vertical Layout */
.woolements-ph-layout-vertical .woolements-ph-feature-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.woolements-ph-layout-vertical .woolements-ph-feature-separator {
    display: none;
}

.woolements-ph-layout-vertical .woolements-ph-feature-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--ph-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woolements-ph-layout-vertical .woolements-ph-feature-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--ph-text-color);
}

/* Inline Layout */
.woolements-ph-layout-inline .woolements-ph-feature-content {
    display: inline;
}

.woolements-ph-layout-inline .woolements-ph-feature-title,
.woolements-ph-layout-inline .woolements-ph-feature-value {
    display: inline;
}

/* ================================
   TREE STYLE
   ================================ */
.woolements-ph-style-tree .woolements-ph-group-content {
    padding-right: 30px;
}

.woolements-ph-tree-line {
    position: absolute;
    right: 20px;
    top: 0;
    bottom: 12px;
    width: 0;
    border-right-width: 2px;
    border-right-style: solid;
    border-right-color: var(--ph-border-color);
}

.woolements-ph-tree-connector {
    position: absolute;
    right: -10px;
    top: 50%;
    width: 10px;
    height: 0;
    border-bottom-width: 2px;
    border-bottom-style: solid;
    border-bottom-color: var(--ph-border-color);
}

/* Tree line styles */
.woolements-ph-tree-solid {
    border-style: solid !important;
}

.woolements-ph-tree-dashed {
    border-style: dashed !important;
}

.woolements-ph-tree-dotted {
    border-style: dotted !important;
}

/* ================================
   ACCORDION STYLE
   ================================ */
.woolements-ph-style-accordion .woolements-ph-group {
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--ph-border-color);
}

.woolements-ph-style-accordion .woolements-ph-group:first-child {
    border-radius: var(--ph-border-radius) var(--ph-border-radius) 0 0;
}

.woolements-ph-style-accordion .woolements-ph-group:last-child {
    border-radius: 0 0 var(--ph-border-radius) var(--ph-border-radius);
    border-bottom: none;
}

.woolements-ph-style-accordion .woolements-ph-group:only-child {
    border-radius: var(--ph-border-radius);
}

/* ================================
   TABS STYLE
   ================================ */
.woolements-ph-style-tabs {
    display: flex;
    flex-direction: column;
}

.woolements-ph-style-tabs .woolements-ph-groups-wrapper {
    display: flex;
    flex-direction: column;
}

/* ================================
   LIST STYLE
   ================================ */
.woolements-ph-style-list .woolements-ph-group {
    box-shadow: none;
    background: transparent;
}

.woolements-ph-style-list .woolements-ph-group-header {
    background: transparent;
    padding: 12px 0;
    border-bottom: 2px solid var(--ph-primary-color);
}

.woolements-ph-style-list .woolements-ph-group-content {
    padding: 16px 0;
}

/* ================================
   EMPTY STATE
   ================================ */
.woolements-ph-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--ph-text-muted);
    font-size: 14px;
    background: #f8fafc;
    border-radius: var(--ph-border-radius);
    border: 2px dashed var(--ph-border-color);
}

/* ================================
   RESPONSIVE STYLES
   ================================ */
@media (max-width: 768px) {
    .woolements-ph-group-header {
        padding: 14px 16px;
    }
    
    .woolements-ph-group-content {
        padding: 14px 16px;
    }
    
    .woolements-ph-group-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .woolements-ph-group-title {
        font-size: 15px;
    }
    
    .woolements-ph-feature-item {
        padding: 12px 14px;
    }
    
    .woolements-ph-feature-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .woolements-ph-style-tree .woolements-ph-group-content {
        padding-right: 24px;
    }
}

@media (max-width: 480px) {
    .woolements-ph-feature-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .woolements-ph-feature-separator {
        display: none;
    }
}

/* ================================
   RTL SUPPORT
   ================================ */
[dir="ltr"] .woolements-product-highlights {
    direction: ltr;
}

[dir="ltr"] .woolements-ph-group-icon {
    margin-left: 0;
    margin-right: 12px;
}

[dir="ltr"] .woolements-ph-feature-icon {
    margin-left: 0;
    margin-right: 12px;
}

[dir="ltr"] .woolements-ph-style-tree .woolements-ph-group-content {
    padding-right: 20px;
    padding-left: 30px;
}

[dir="ltr"] .woolements-ph-tree-line {
    right: auto;
    left: 20px;
    border-right: none;
    border-left-width: 2px;
    border-left-style: solid;
    border-left-color: var(--ph-border-color);
}

[dir="ltr"] .woolements-ph-tree-connector {
    right: auto;
    left: -10px;
}

/* ================================
   DARK MODE SUPPORT (optional)
   ================================ */
.dark-mode .woolements-product-highlights,
[data-theme="dark"] .woolements-product-highlights {
    --ph-bg-color: #1e293b;
    --ph-border-color: #334155;
    --ph-text-color: #f1f5f9;
    --ph-text-muted: #94a3b8;
    --ph-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dark-mode .woolements-ph-group-header,
[data-theme="dark"] .woolements-ph-group-header {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

.dark-mode .woolements-ph-collapsible .woolements-ph-group-header:hover,
[data-theme="dark"] .woolements-ph-collapsible .woolements-ph-group-header:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.dark-mode .woolements-ph-feature-item,
[data-theme="dark"] .woolements-ph-feature-item {
    background: #334155;
}

.dark-mode .woolements-ph-feature-item:hover,
[data-theme="dark"] .woolements-ph-feature-item:hover {
    background: #475569;
    border-color: #475569;
}

.dark-mode .woolements-ph-toggle-icon,
[data-theme="dark"] .woolements-ph-toggle-icon {
    background: rgba(255, 255, 255, 0.1);
}

.dark-mode .woolements-ph-empty,
[data-theme="dark"] .woolements-ph-empty {
    background: #334155;
    border-color: #475569;
}

/* ================================
   PRINT STYLES
   ================================ */
@media print {
    .woolements-product-highlights {
        box-shadow: none !important;
    }
    
    .woolements-ph-group {
        box-shadow: none !important;
        break-inside: avoid;
    }
    
    .woolements-ph-toggle-icon {
        display: none !important;
    }
    
    .woolements-ph-group-content {
        max-height: none !important;
        opacity: 1 !important;
        padding: 16px 20px !important;
    }
}
