/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-top {
    position: absolute;
    top: 15px;
    right: 30px;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-selector label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.language-selector select {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.language-selector select:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.language-selector select option {
    background-color: #333;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 入力セクション */
.input-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.input-section h2 {
    color: #444;
    margin-bottom: 25px;
    font-size: 1.8em;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* チェックボックス専用スタイル */
.checkbox-group {
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
    transform: scale(1.2);
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ローディング */
.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 結果セクション */
.results-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.results-section h2 {
    color: #444;
    margin-bottom: 25px;
    font-size: 1.8em;
    text-align: center;
}

/* 予算サマリー */
.budget-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.budget-info,
.price-info,
.status-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.budget-summary .label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.budget-summary .value {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
}

.status {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    animation: statusFadeIn 0.5s ease-out;
}

@keyframes statusFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status.within-budget {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #b8dabc;
    box-shadow: 0 2px 8px rgba(21, 87, 36, 0.15);
}

.status.within-budget:hover {
    background: linear-gradient(135deg, #c3e6cb 0%, #b8dabc 100%);
    box-shadow: 0 4px 12px rgba(21, 87, 36, 0.25);
    transform: translateY(-1px);
}

.status.over-budget {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #f1b0b7;
    box-shadow: 0 2px 8px rgba(114, 28, 36, 0.15);
}

.status.over-budget:hover {
    background: linear-gradient(135deg, #f5c6cb 0%, #f1b0b7 100%);
    box-shadow: 0 4px 12px rgba(114, 28, 36, 0.25);
    transform: translateY(-1px);
}

/* パーツテーブル */
.parts-table-container {
    overflow-x: auto;
}

.parts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.parts-table th,
.parts-table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.parts-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

.parts-table tr:hover {
    background: #f8f9fa;
}

.part-category {
    font-weight: 600;
    color: #667eea;
}

.part-name {
    color: #333;
    font-weight: 500;
}

.part-price {
    font-weight: 600;
    color: #28a745;
}

.part-specs {
    font-size: 0.9em;
    color: #666;
}

/* エラーメッセージ */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
    border: 1px solid #f5c6cb;
}

/* ユーティリティクラス */
.hidden {
    display: none;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    header p {
        font-size: 1em;
    }
    
    .input-section,
    .results-section {
        padding: 20px;
    }
    
    .budget-summary {
        flex-direction: column;
        text-align: center;
    }
    
    .budget-info,
    .price-info,
    .status-info {
        width: 100%;
    }
    
    .parts-table th,
    .parts-table td {
        padding: 10px 8px;
        font-size: 0.9em;
    }
    
    .submit-btn {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 0;
    }
    
    header h1 {
        font-size: 1.7em;
    }
    
    .input-section h2,
    .results-section h2 {
        font-size: 1.5em;
    }
    
    .parts-table {
        font-size: 0.8em;
    }
    
    .parts-table th,
    .parts-table td {
        padding: 8px 6px;
    }
}

/* Tarkov用途でのCPUブランド制御 */
.tarkov-disabled {
    filter: grayscale(100%);
    opacity: 0.6;
    cursor: not-allowed !important;
    background-color: #f0f0f0 !important;
    color: #888 !important;
    pointer-events: none;
}

.tarkov-disabled:hover {
    background-color: #f0f0f0 !important;
}

/* Tarkov用途選択時の視覚的フィードバック */
select#cpu-brand.tarkov-disabled {
    background-image: none;
    border-color: #ddd;
}

select#cpu-brand.tarkov-disabled option {
    color: #888;
}