/**
 * 納期シミュレーター CSS（コンパクト版）
 * なまけもの印刷 (irie-design.com)
 */

/* ========================================
   シミュレーターコンテナ
   ======================================== */
.delivery-simulator {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    margin: 12px auto;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(245, 166, 35, 0.3);
}

.delivery-simulator-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f5a623;
}

.delivery-simulator-title i {
    color: #f5a623;
    font-size: 16px;
}

/* ========================================
   入力エリア
   ======================================== */
.simulator-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.simulator-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.simulator-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.simulator-field label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.simulator-field label i {
    color: #f5a623;
    font-size: 11px;
}

/* 納期タイプ選択 */
.delivery-type-select {
    position: relative;
}

.delivery-type-select select {
    width: 100%;
    height: 36px;
    padding: 0 28px 0 10px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.delivery-type-select select:hover,
.delivery-type-select select:focus {
    border-color: #f5a623;
    outline: none;
}

.delivery-type-select::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Pro', 'Font Awesome 5 Free', FontAwesome;
    font-weight: 900;
    font-size: 10px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

/* 日付入力 */
.date-input-wrapper input[type="date"] {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.date-input-wrapper input[type="date"]:hover,
.date-input-wrapper input[type="date"]:focus {
    border-color: #f5a623;
    outline: none;
}

/* ========================================
   計算ボタン
   ======================================== */
.simulator-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f5a623 0%, #e8940f 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.simulator-btn:hover {
    background: linear-gradient(135deg, #e8940f 0%, #d4820a 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(245, 166, 35, 0.3);
}

.simulator-btn i {
    font-size: 13px;
}

/* ========================================
   結果表示エリア
   ======================================== */
.simulator-result {
    margin-top: 12px;
    padding: 12px;
    background: #fffaf0;
    border-radius: 6px;
    border: 1px solid #f5a623;
    display: none;
    animation: fadeIn 0.3s ease;
}

.simulator-result.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.result-header {
    display: none;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #fff;
    border-radius: 4px;
    font-size: 11px;
}

.result-item-label {
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-item-label i {
    color: #f5a623;
    font-size: 11px;
}

.result-item-value {
    font-weight: 600;
    color: #333;
}

/* 発送日ハイライト */
.shipping-date-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #f5a623 0%, #e8940f 100%);
    border-radius: 6px;
    color: #fff;
    text-align: center;
}

.shipping-date-box .label {
    font-size: 11px;
    opacity: 0.9;
}

.shipping-date-box .date {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.shipping-date-box .weekday {
    font-size: 13px;
    opacity: 0.9;
}

/* 注意事項 */
.result-notes {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.result-notes p {
    font-size: 10px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.result-notes p i {
    color: #3498db;
    margin-right: 4px;
}

/* ========================================
   納期タイプ説明（折りたたみ式）
   ======================================== */
.delivery-type-info {
    margin-top: 10px;
}

.delivery-type-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 6px;
    font-size: 11px;
    color: #666;
    background: #f8f9fa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delivery-type-toggle:hover {
    background: #f0f0f0;
    color: #333;
}

.delivery-type-toggle i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.delivery-type-toggle.active i {
    transform: rotate(180deg);
}

.delivery-type-list {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.delivery-type-list.show {
    display: flex;
}

.delivery-type-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #fff;
    border-radius: 4px;
    font-size: 10px;
    flex: 1 1 45%;
    min-width: 140px;
}

.delivery-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    border-radius: 10px;
}

.delivery-type-badge.type-super {
    background: #e74c3c;
}

.delivery-type-badge.type-express {
    background: #f5a623;
}

.delivery-type-badge.type-standard {
    background: #3498db;
}

.delivery-type-badge.type-economy {
    background: #27ae60;
}

.delivery-type-badge.type-slow {
    background: #95a5a6;
}

.delivery-type-desc {
    color: #666;
    white-space: nowrap;
}

/* ========================================
   ローディング・エラー
   ======================================== */
.simulator-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: #666;
    font-size: 12px;
}

.simulator-loading.show {
    display: flex;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f0f0f0;
    border-top-color: #f5a623;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.simulator-error {
    display: none;
    padding: 10px;
    background: #fef2f2;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    margin-top: 10px;
}

.simulator-error.show {
    display: block;
}

.simulator-error p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 11px;
    color: #c0392b;
}

/* ========================================
   カレンダー内ハイライト
   ======================================== */
.calendar-table tbody td.shipping-highlight {
    background: #f5a623 !important;
    color: #fff !important;
    font-weight: 700;
    border-radius: 50%;
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media (max-width: 480px) {
    .delivery-simulator {
        padding: 12px;
        margin: 10px auto;
    }

    .simulator-row {
        flex-direction: column;
        gap: 8px;
    }

    .delivery-type-item {
        flex: 1 1 100%;
    }
}
