/* 基本スタイル */
.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

/* 計算タイプ選択 */
.calc-type-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.type-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.type-btn {
    padding: 1rem 2rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    min-width: 200px;
}

.type-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-2px);
}

.type-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* 計算セクション */
.calc-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.calc-input-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.input-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.input-field {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.unit-label {
    font-weight: 600;
    color: #64748b;
    font-size: 1rem;
    min-width: 2rem;
}

/* 税率ボタン */
.tax-rate-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tax-rate-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.tax-rate-btn:hover {
    border-color: #059669;
    color: #059669;
}

.tax-rate-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.custom-rate-input {
    margin-top: 0.5rem;
}

/* 計算ボタン */
.calc-button {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.calc-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
}

.calc-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 計算結果 */
.results-section {
    margin-bottom: 2rem;
}

.result-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #10b981;
}

.result-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.result-item {
    flex: 1;
    min-width: 200px;
}

.result-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.result-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    font-family: 'Courier New', monospace;
}

.result-copy {
    display: flex;
    gap: 0.5rem;
}

.copy-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #10b981;
    border-radius: 6px;
    background: white;
    color: #10b981;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #10b981;
    color: white;
}

.copy-btn.copied {
    background: #059669;
    border-color: #059669;
    color: white;
}

.copy-icon {
    width: 14px;
    height: 14px;
}

/* 詳細計算 */
.result-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    gap: 1rem;
}

.detail-label {
    font-weight: 600;
    color: #374151;
    min-width: 100px;
}

.detail-value {
    font-weight: 600;
    color: #1f2937;
    font-family: 'Courier New', monospace;
    flex: 1;
    text-align: right;
}

.detail-copy-btn {
    padding: 0.25rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-copy-btn:hover {
    border-color: #10b981;
    color: #10b981;
}

.copy-icon-small {
    width: 12px;
    height: 12px;
}

/* 計算例 */
.examples-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.example-card {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.example-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    text-align: center;
}

.example-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.example-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.example-input {
    color: #4b5563;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    min-width: 130px;
}

.example-arrow {
    color: #3b82f6;
    font-weight: bold;
    font-size: 1.1rem;
}

.example-output {
    color: #059669;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    flex: 1;
    min-width: 130px;
}

.example-try {
    padding: 0.25rem 0.75rem;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    background: white;
    color: #3b82f6;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.example-try:hover {
    background: #3b82f6;
    color: white;
}

/* 消費税率情報 */
.tax-info-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.tax-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tax-info-card {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.tax-info-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.tax-info-desc {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.tax-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tax-info-list li {
    color: #4b5563;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding-left: 0;
}

/* 説明セクション */
.action-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .type-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .type-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .tax-rate-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tax-rate-btn {
        width: 100%;
        text-align: center;
    }
    
    .result-main {
        flex-direction: column;
        text-align: center;
    }
    
    .result-copy {
        justify-content: center;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .detail-value {
        text-align: left;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .example-item {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .tax-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .calc-section,
    .examples-section,
    .tax-info-section,
    .calc-type-section,
    .action-section {
        padding: 1.5rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .example-card,
    .tax-info-card {
        padding: 1rem;
    }
}