/**
 * Premium Image Comparison Enhanced Widget Styles
 * Advanced styling for multiple configurations
 */

/* 主容器 */
.premium-comparison-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.premium-comparison-container {
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.premium-comparison-container.transitioning {
    opacity: 0.7;
}

/* 配置選擇器容器 */
.config-selectors-wrapper {
    position: absolute;
    z-index: 100;
    display: flex;
    gap: 10px;
}

/* 位置變化 - 右上角 */
.config-selectors-wrapper.position-top-right {
    top: 20px;
    right: 20px;
}

/* 位置變化 - 左上角 */
.config-selectors-wrapper.position-top-left {
    top: 20px;
    left: 20px;
}

/* 位置變化 - 右下角 */
.config-selectors-wrapper.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* 位置變化 - 左下角 */
.config-selectors-wrapper.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* 配置選擇器按鈕 - 方框樣式 */
.config-selector {
    width: 120px;
    height: 60px;
    border-radius: 0px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 8px;
}

.config-selector:hover {
    transform: translateY(-2px);
}

.config-selector.active {
    border-color: #889c80;
    border-width: 1px;
}

.config-selector.active .config-icon {
    color: #889c80;
}

/* 配置圖標 */
.config-icon {
    font-size: 24px;
    color: #666666;
    transition: color 0.3s ease;
}

.config-selector:hover .config-icon {
    color: #007cba;
}

/* 配置圖片圖標 */
.config-icon-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 配置標籤 */
.config-label {
    position: absolute;
    bottom: -25px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
}

.config-selector:hover .config-label {
    opacity: 1;
    transform: translateY(0);
}

.config-selector.active .config-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 配置信息顯示 */
.config-info-display {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: none;
}

.config-info-display.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.config-info-display h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.config-info-display p {
    margin: 0;
    color: #5a6c7d;
    line-height: 1.6;
    font-size: 14px;
}

/* 比較標籤樣式 - 預設隱藏 */
.premium-twentytwenty-before-label,
.premium-twentytwenty-after-label {
    display: none !important;
}

/* 自定義拉桿樣式 */
.premium-twentytwenty-handle {
    background: #ffffff;
    width: 60px;
    height: 60px;
    border: 1px solid #000000;
    box-shadow: none;
}

/* 拉桿線條樣式 */
.premium-twentytwenty-handle:before,
.premium-twentytwenty-handle:after {
    background: #000000;
    box-shadow: none;
}

/* 垂直線條樣式 */
.premium-img-compare-horizontal .premium-twentytwenty-handle:before {
    width: 2px;
    height: 9999px;
    background: #000000;
    box-shadow: none;
}

/* 自定義左右箭頭 */
.premium-twentytwenty-left-arrow,
.premium-twentytwenty-right-arrow {
    border: none !important;
    width: 20px !important;
    height: 20px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.premium-twentytwenty-left-arrow {
    left: 50% !important;
    margin-left: -25px !important;
    margin-top: -10px !important;
}

.premium-twentytwenty-right-arrow {
    right: 50% !important;
    margin-right: -25px !important;
    margin-top: -10px !important;
}

/* 前圖遮罩效果 */
.premium-twentytwenty-container .premium-twentytwenty-before::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* SVG 引導線樣式 */
.guide-lines-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
}

.guide-line {
    stroke: #889c80;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 5, 5;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

.guide-line-target {
    fill: #889c80;
    fill-opacity: 0.3;
    stroke: #889c80;
    stroke-width: 2;
    filter: drop-shadow(0 0 8px rgba(136, 156, 128, 0.6));
}

/* 引導線標籤 */
.guide-line-label {
    fill: #333;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .config-selectors-wrapper.position-top-right,
    .config-selectors-wrapper.position-top-left,
    .config-selectors-wrapper.position-bottom-right,
    .config-selectors-wrapper.position-bottom-left {
        position: absolute;
    }
    
    .config-selector {
        width: 90px;
        height: 45px;
    }
    
    .config-icon {
        font-size: 20px;
    }
    
    .config-icon-image {
        max-width: 100%;
        max-height: 100%;
    }
    
    .config-label {
        font-size: 11px;
        bottom: -20px;
    }
    
    .config-info-display {
        padding: 15px;
    }
    
    .config-info-display h4 {
        font-size: 18px;
    }
    
    .config-info-display p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .config-selectors-wrapper {
        gap: 8px;
    }
    
    .config-selector {
        width: 70px;
        height: 40px;
        padding: 4px;
    }
    
    .config-icon {
        font-size: 18px;
    }
    
    .config-icon-image {
        max-width: 100%;
        max-height: 100%;
    }
}

/* 動畫效果 - 脈動動畫已完全移除 */

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
    .config-selector {
        background: #2d2d2d;
        border-color: #444444;
        color: #ffffff;
    }
    
    .config-selector:hover {
        border-color: #667eea;
    }
    
    .config-icon {
        color: #cccccc;
    }
    
    .config-info-display {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    }
    
    .config-info-display h4 {
        color: #ffffff;
    }
    
    .config-info-display p {
        color: #b0b0b0;
    }
}

/* 載入動畫 */
.premium-comparison-container.loading {
    position: relative;
}

.premium-comparison-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 工具提示 */
.ui-tooltip {
    background: #333333;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 250px;
}

/* 無障礙支援 */
.config-selector:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.config-selector[aria-pressed="true"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 列印樣式 */
@media print {
    .config-selectors-wrapper {
        display: none;
    }
    
    .config-info-display {
        border: 1px solid #000000;
        background: none;
    }
}

/* Elementor 編輯器樣式 - 深色主題優化 */
.elementor-panel .elementor-control-type-repeater .elementor-repeater-fields {
    background: #2c2f33 !important;
    border-left: 3px solid #71d7f7 !important;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.elementor-panel .elementor-control-type-repeater .elementor-repeater-fields:hover {
    background: #35383d !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* 確保文字在深色背景上可見 */
.elementor-panel .elementor-control-type-repeater .elementor-repeater-fields .elementor-control-title {
    color: #e0e0e0 !important;
    font-weight: 500;
}

.elementor-panel .elementor-control-type-repeater .elementor-repeater-fields .elementor-control-field-description {
    color: #b4b4b4 !important;
}

.elementor-panel .elementor-control-type-repeater .elementor-repeater-fields .elementor-control-input-wrapper input,
.elementor-panel .elementor-control-type-repeater .elementor-repeater-fields .elementor-control-input-wrapper textarea {
    background: #1f2124 !important;
    color: #ffffff !important;
    border-color: #444444 !important;
}

.elementor-panel .elementor-control-type-repeater .elementor-repeater-fields .elementor-control-input-wrapper input:focus,
.elementor-panel .elementor-control-type-repeater .elementor-repeater-fields .elementor-control-input-wrapper textarea:focus {
    border-color: #71d7f7 !important;
    background: #252729 !important;
}

/* Repeater 拖曳手把 */
.elementor-panel .elementor-control-type-repeater .elementor-repeater-row-handle {
    background: #3a3d41 !important;
    color: #a0a0a0 !important;
}

.elementor-panel .elementor-control-type-repeater .elementor-repeater-row-handle:hover {
    background: #444750 !important;
    color: #ffffff !important;
}

/* Repeater 工具列 */
.elementor-panel .elementor-control-type-repeater .elementor-repeater-row-tools {
    background: #2c2f33 !important;
    border-color: #444444 !important;
}

.elementor-panel .elementor-control-type-repeater .elementor-repeater-row-tools > div {
    color: #a0a0a0 !important;
}

.elementor-panel .elementor-control-type-repeater .elementor-repeater-row-tools > div:hover {
    color: #71d7f7 !important;
}

/* Switch 控制項樣式 */
.elementor-panel .elementor-control-type-repeater .elementor-control-type-switcher .elementor-switch {
    background-color: #444444 !important;
}

.elementor-panel .elementor-control-type-repeater .elementor-control-type-switcher .elementor-switch-input:checked ~ .elementor-switch-label {
    background-color: #71d7f7 !important;
}

/* 選擇器下拉選單 */
.elementor-panel .elementor-control-type-repeater .elementor-control-type-select select {
    background: #1f2124 !important;
    color: #ffffff !important;
    border-color: #444444 !important;
}

.elementor-panel .elementor-control-type-repeater .elementor-control-type-select select:focus {
    border-color: #71d7f7 !important;
}

/* 圖標選擇器 */
.elementor-panel .elementor-control-type-repeater .elementor-control-type-icons .elementor-control-icon-picker {
    background: #1f2124 !important;
    border-color: #444444 !important;
    color: #ffffff !important;
}

.elementor-panel .elementor-control-type-repeater .elementor-control-type-icons .elementor-control-icon-picker:hover {
    border-color: #71d7f7 !important;
}

/* 媒體選擇器 */
.elementor-panel .elementor-control-type-repeater .elementor-control-media .elementor-control-media__content {
    background: #1f2124 !important;
    border-color: #444444 !important;
}

.elementor-panel .elementor-control-type-repeater .elementor-control-media:hover .elementor-control-media__content {
    border-color: #71d7f7 !important;
}

/* 活動狀態的 Repeater 項目 */
.elementor-panel .elementor-control-type-repeater .elementor-repeater-fields.active {
    background: #3a3d41 !important;
    border-left-color: #667eea !important;
}

/* 新增項目按鈕 */
.elementor-panel .elementor-control-type-repeater .elementor-button-default {
    background: #71d7f7 !important;
    color: #1f2124 !important;
    font-weight: 600;
}

.elementor-panel .elementor-control-type-repeater .elementor-button-default:hover {
    background: #5bc0de !important;
}