/* WCFM Gift Manager Frontend Styles */

/* ギフトオプション全体のスタイル */
.wcfm-gift-option {
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #e3f2fd;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    position: relative;
    overflow: hidden;
}

.wcfm-gift-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #2196F3 0%, #21CBF3 100%);
}

.wcfm-gift-option h4 {
    margin: 0 0 15px 0;
    color: #1976d2;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.wcfm-gift-option h4::before {
    content: '🎁';
    margin-right: 10px;
    font-size: 1.2em;
}

/* ギフトトグル */
.gift-toggle-container {
    margin-bottom: 15px;
}

.gift-toggle-container label {
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.gift-toggle-container input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

/* ギフト詳細フォーム */
#gift-details {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 15px;
}

.gift-recipient-info,
.gift-message,
.gift-delivery-option {
    margin-bottom: 15px;
}

.gift-recipient-info label,
.gift-message label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.gift-recipient-info input,
.gift-message textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.gift-recipient-info input:focus,
.gift-message textarea:focus {
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    outline: none;
}

.gift-recipient-info input.error,
.gift-message textarea.error {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

/* 配送オプション */
.gift-delivery-option label {
    font-weight: normal !important;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.gift-delivery-option input[type="radio"] {
    margin-right: 8px;
}

.delivery-method-description {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-style: italic;
    margin-top: 10px;
}

/* ギフト注意事項 */
.gift-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    margin-top: 15px !important;
    font-size: 0.9em;
    line-height: 1.4;
}

/* 通知メッセージ */
.wcfm-gift-notification {
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid;
}

.wcfm-gift-notification-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.wcfm-gift-notification-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.wcfm-gift-notification p {
    margin: 0;
    font-weight: 500;
}

/* フィールドエラー */
.field-error {
    color: #e74c3c !important;
    font-size: 0.9em !important;
    display: block;
    margin-top: 5px;
    font-weight: 500;
}

/* 文字数カウンター */
.char-counter {
    font-size: 0.8em;
    color: #666;
    float: right;
    margin-top: 5px;
}

/* カートアイテムのギフト表示 */
.woocommerce-cart .cart_item .gift-indicator {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    margin-left: 10px;
}

.woocommerce-cart .cart_item .gift-indicator::before {
    content: '🎁 ';
}

/* チェックアウトページでのギフト表示 */
.woocommerce-checkout .gift-item-info {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 3px solid #2196F3;
}

.woocommerce-checkout .gift-item-info strong {
    color: #1976d2;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .wcfm-gift-option {
        margin: 15px 0;
        padding: 15px;
    }
    
    .wcfm-gift-option h4 {
        font-size: 1.2em;
    }
    
    .gift-recipient-info input,
    .gift-message textarea {
        padding: 10px;
        font-size: 16px; /* iOS のズーム防止 */
    }
    
    .char-counter {
        float: none;
        display: block;
        text-align: right;
        margin-top: 5px;
    }
}

/* アニメーション */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wcfm-gift-notification {
    animation: slideInDown 0.3s ease-out;
}

/* ホバー効果 */
.gift-toggle-container label:hover,
.gift-delivery-option label:hover {
    color: #1976d2;
    transition: color 0.2s ease;
}

/* フォーカス表示の改善 */
.gift-toggle-container input[type="checkbox"]:focus,
.gift-delivery-option input[type="radio"]:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* ギフトURLページ（受け取りページ）のスタイル */
.wcfm-gift-redemption-page {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 800px;
}

.gift-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gift-card h1 {
    margin: 0 0 15px 0;
    font-size: 2.5em;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gift-card .gift-icon {
    font-size: 4em;
    margin-bottom: 20px;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gift-details {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin: 25px 0;
    border: 1px solid #e9ecef;
}

.gift-product-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.gift-product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.redemption-form {
    background: #fff;
    padding: 30px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin-top: 25px;
}

.redemption-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.redemption-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
}

.redemption-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.error-message,
.success-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 500;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.login-required {
    background: #fff3cd;
    color: #856404;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    text-align: center;
    margin: 25px 0;
}

.login-required .button {
    background: #007cba;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    margin: 0 5px;
    display: inline-block;
    transition: background 0.3s ease;
}

.login-required .button:hover {
    background: #005a87;
}