/* ==============================================
   WooCommerce Price Survey Modal Styles
   ============================================== */

/* モーダルオーバーレイ */
.wc-price-survey-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* モーダルコンテンツ */
.wc-price-survey-modal-content {
    background-color: #ffffff;
    margin: 0;
    padding: 30px;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    animation: modalAppear 0.3s ease-out forwards;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes modalAppear {
    to {
        transform: scale(1);
    }
}

/* 閉じるボタン */
.wc-price-survey-close {
    color: #999;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
}

.wc-price-survey-close:hover,
.wc-price-survey-close:focus {
    color: #333;
    background-color: #f0f0f0;
    transform: scale(1.1);
}

/* タイトル */
.wc-price-survey-modal-content h3 {
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.4;
    padding-right: 40px;
}

/* 評価ボタンコンテナ */
.rating-buttons {
    display: flex;
    gap: 12px;
    margin: 25px 0;
    justify-content: center;
    flex-wrap: wrap;
}

/* 評価ボタン */
.rating-btn {
    padding: 12px 24px;
    border: 2px solid #e1e5e9;
    background: #ffffff;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    min-width: 90px;
    position: relative;
    overflow: hidden;
}

.rating-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.rating-btn:hover::before {
    left: 100%;
}

.rating-btn:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

.rating-btn.active {
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.rating-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.2);
}

/* 価格提案セクション */
#price-suggestion {
    margin: 25px 0;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

#price-suggestion h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* 価格選択ドロップダウン */
#suggested-price {
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 150px;
}

#suggested-price:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* アクションボタンコンテナ */
.survey-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* アクションボタン */
.survey-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 100px;
    position: relative;
    overflow: hidden;
}

#submit-survey {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

#submit-survey:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

#submit-survey:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#close-survey {
    display: none;
}

#close-thank-you {
    background: #f8f9fa;
    color: #555;
    border: 2px solid #e1e5e9;
}

#close-survey:hover,
#close-thank-you:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

/* 感謝メッセージ */
#thank-you-message {
    text-align: center;
    padding: 20px 0;
}

#thank-you-message h3 {
    color: #28a745;
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#thank-you-message h3::before {
    content: '✓';
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

/* ローディング状態 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .wc-price-survey-modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 25px 20px;
    }
    
    .rating-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .rating-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .survey-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .survey-buttons button {
        width: 100%;
        max-width: 200px;
    }
    
    .wc-price-survey-modal-content h3 {
        font-size: 18px;
        padding-right: 30px;
    }
}

@media (max-width: 480px) {
    .wc-price-survey-modal-content {
        width: 98%;
        padding: 20px 15px;
    }
    
    .wc-price-survey-close {
        right: 15px;
        top: 15px;
    }
    
    #price-suggestion {
        padding: 15px;
    }
    
    .wc-price-survey-modal-content h3 {
        font-size: 16px;
        margin-bottom: 20px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .wc-price-survey-modal {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .wc-price-survey-modal-content {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .wc-price-survey-modal-content h3,
    #price-suggestion h4 {
        color: #e2e8f0;
    }
    
    .rating-btn {
        background: #4a5568;
        border-color: #5a5a5a;
        color: #e2e8f0;
    }
    
    .rating-btn:hover {
        border-color: #63b3ed;
    }
    
    #price-suggestion {
        background: #4a5568;
        border-color: #63b3ed;
    }
    
    #suggested-price {
        background: #4a5568;
        border-color: #5a5a5a;
        color: #e2e8f0;
    }
    
    #close-thank-you {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #5a5a5a;
    }
}

/* アクセシビリティ向上 */
@media (prefers-reduced-motion: reduce) {
    .wc-price-survey-modal,
    .wc-price-survey-modal-content,
    .rating-btn,
    .survey-buttons button {
        animation: none;
        transition: none;
    }
    
    .rating-btn:hover,
    .survey-buttons button:hover {
        transform: none;
    }
}

/* 高コントラストモード */
@media (prefers-contrast: high) {
    .rating-btn {
        border-width: 3px;
    }
    
    .rating-btn.active {
        background: #000;
        color: #fff;
    }
    
    #submit-survey {
        background: #000;
        color: #fff;
    }
}

/* フォーカス表示強化 */
.rating-btn:focus-visible,
.survey-buttons button:focus-visible,
#suggested-price:focus-visible {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

/* 印刷時は非表示 */
@media print {
    .wc-price-survey-modal {
        display: none !important;
    }
}