﻿/* ==================== 샘플값 시스템 CSS ==================== */

/* ==================== 샘플값 버튼 그룹 ==================== */

.sample-buttons-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

/* 계산하기, 샘플값, 초기화 버튼 */
.btn-calculate,
.btn-sample,
.btn-reset {
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Primary: 계산하기 */
.btn-calculate {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    padding: 0 28px;
    flex: 0 0 auto;
    min-width: 120px;
}

.btn-calculate:hover {
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.btn-calculate:active {
    transform: translateY(0);
}

/* Secondary: 샘플값 */
.btn-sample {
    background: #f3f4f6;
    color: #1f2937;
    border: 2px solid #d1d5db;
    padding: 0 24px;
    flex: 0 0 auto;
    min-width: 110px;
}

.btn-sample:hover {
    background: #e5e7eb;
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.btn-sample.active {
    background: #e9d5ff;
    border-color: #8b5cf6;
    color: #6d28d9;
}

/* Ghost: 초기화 */
.btn-reset {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 0 22px;
    flex: 0 0 auto;
    min-width: 100px;
}

.btn-reset:hover {
    background: #f3f4f6;
    color: #1f2937;
    border-color: #9ca3af;
}

/* ==================== 샘플값 패널 (펼쳐짐) ==================== */

#samplePresetsContainer {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    padding: 16px 0;
    margin-bottom: 20px;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    animation: slideDown 0.3s ease-out;
}

#samplePresetsContainer.visible {
    display: grid;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* 샘플값 개별 버튼 */
.sample-preset-btn {
    padding: 12px 14px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.3;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sample-preset-btn:hover {
    border-color: #8b5cf6;
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.sample-preset-btn.active {
    background: #e9d5ff;
    border-color: #8b5cf6;
    color: #6d28d9;
}

/* 샘플 버튼 라벨 */
.sample-btn-label {
    font-weight: 600;
    color: #1f2937;
}

.sample-preset-btn.active .sample-btn-label {
    color: #6d28d9;
}

/* 샘플 버튼 설명 */
.sample-btn-desc {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: normal;
}

.sample-preset-btn.active .sample-btn-desc {
    color: #8b5cf6;
}

/* ==================== 토스트 메시지 ==================== */

.sample-applied-toast,
.reset-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 22px;
    background: #10b981;
    color: white;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
    z-index: 1000;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid #059669;
    letter-spacing: -0.3px;
}

.reset-toast {
    background: #3b82f6;
    border-left-color: #1d4ed8;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sample-applied-toast.fade-out,
.reset-toast.fade-out {
    animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* ==================== 반응형 (태블릿) ==================== */

@media (max-width: 1024px) {
    .sample-buttons-wrapper {
        gap: 12px;
    }
    
    .btn-calculate,
    .btn-sample,
    .btn-reset {
        height: 44px;
    }
    
    #samplePresetsContainer {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .sample-applied-toast,
    .reset-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
}

/* ==================== 반응형 (모바일) ==================== */

@media (max-width: 640px) {
    .sample-buttons-wrapper {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .btn-calculate {
        flex: 1 1 auto;
        min-width: 100px;
    }
    
    .btn-sample,
    .btn-reset {
        flex: 0 1 auto;
        min-width: 90px;
    }
    .btn-reset {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    #samplePresetsContainer {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px 0;
    }
    
    .sample-preset-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .sample-btn-label {
        font-size: 0.8rem;
    }
    
    .sample-btn-desc {
        font-size: 0.7rem;
    }
    
    .sample-applied-toast,
    .reset-toast {
        bottom: 12px;
        right: 12px;
        left: 12px;
        font-size: 0.85rem;
        padding: 10px 14px;
    }
}

/* ==================== 어두운 테마 대응 (선택사항) ==================== */

@media (prefers-color-scheme: dark) {
    .btn-sample {
        background: #374151;
        color: #f3f4f6;
        border-color: #4b5563;
    }
    
    .btn-sample:hover {
        background: #4b5563;
        border-color: #8b5cf6;
    }
    
    #samplePresetsContainer {
        border-color: #4b5563;
    }
    
    .sample-preset-btn {
        background: #1f2937;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .sample-preset-btn:hover {
        background: #374151;
        border-color: #8b5cf6;
    }
    
    .sample-preset-btn.active {
        background: #6d28d9;
        border-color: #8b5cf6;
        color: white;
    }
    
    .sample-btn-label {
        color: #f3f4f6;
    }
    
    .sample-btn-desc {
        color: #9ca3af;
    }
}

