/*
=====================================================
✅ Material Design 기반 Form + Button 공통 스타일 가이드 (v2.9)
이 파일은 버튼 컴포넌트 `.c-btn`를 중심으로 구성되어 있으며,
기능별 / 스타일별 / 상태별로 클래스를 조합하여 사용합니다.

✅ 사용 예시:
<button class="c-btn c-btn--filled c-btn--ok">확인</button>
<button class="c-btn c-btn--outlined c-btn--cancel">취소</button>

✅ 기능 스타일은 --ok, --cancel, --danger 등으로 명시
✅ 시각적 스타일은 --filled, --outlined, --tonal 등으로 구분
✅ 버튼 상태는 .is-disabled, .is-loading 등으로 조합
✅ 색상 테마는 --default, --blue, --green, --red, --lightgrey 등 추가 가능
✅ 사이즈는 기본(default) 외에도 --sm(작은 사이즈), --lg(큰 사이즈)도 제공
✅ 아이콘 전용 버튼 `.c-btn--icon` 제공 (정사각형 아이콘 버튼)

✅ 예시 조합:
<button class="c-btn c-btn--filled c-btn--ok c-btn--blue">확인</button>
<button class="c-btn c-btn--outlined c-btn--danger c-btn--red is-disabled">삭제</button>
<button class="c-btn c-btn--filled c-btn--icon c-btn--green"><span class="icon">★</span></button>

✅ 반응형 대응:
 - PC: 기본 사이즈
 - 태블릿 (max-width: 1024px): padding 및 font 크기 조정
 - 모바일 (max-width: 767px): 더 작게 조정
=====================================================
*/

.c-btn {
    font-size: 14px;
    line-height: 20px;
    padding: 10px 16px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Roboto', sans-serif;
    position: relative;
    min-height: 40px;
}

.c-btn--sm {
    font-size: 13px;
    padding: 6px 12px;
    min-height: 32px;
}

.c-btn--lg {
    font-size: 16px;
    padding: 14px 24px;
    min-height: 48px;
}

.c-btn:focus-visible {
    outline: 2px solid #6200ee;
    outline-offset: 2px;
}

.c-btn:active::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: inherit;
}

.c-btn--ok {
    background-color: #6200ee;
    color: #fff;
}
.c-btn--ok:hover {
    background-color: #5300d6;
}

.c-btn--cancel {
    background-color: transparent;
    color: #666;
    border: 1px solid #999;
}
.c-btn--cancel:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.c-btn--danger {
    background-color: #d32f2f;
    color: #fff;
}
.c-btn--danger:hover {
    background-color: #b71c1c;
}

/* ✅ 스타일 유형별 (Filled, Outlined, Tonal) */
.c-btn--filled {
    background-color: #6200ee;
    color: #fff;
    border-radius: 4px;
    position: relative;
    transition: background-color 0.2s ease;
}

.c-btn--filled:hover::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: inherit;
}

.c-btn--outlined {
    background-color: transparent;
    color: #6200ee;
    border: 1px solid currentColor;
    border-radius: 4px;
    position: relative;
    transition: background-color 0.2s ease;
}

.c-btn--outlined:hover::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(98, 0, 238, 0.08);
    border-radius: inherit;
}

.c-btn--tonal {
    background-color: #e8def8;
    color: #381e72;
    border-radius: 4px;
    position: relative;
    transition: background-color 0.2s ease;
}

.c-btn--tonal:hover::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(56, 30, 114, 0.08);
    border-radius: inherit;
}

/* ✅ 색상 테마 */
.c-btn--default {
    background-color: #6200ee;
    color: #fff;
}
.c-btn--default:hover {
    background-color: #5300d6;
}

.c-btn--blue {
    background-color: #0d6efd;
    color: #fff;
}
.c-btn--blue:hover {
    background-color: #0b5ed7;
}

.c-btn--green {
    background-color: #2e7d32;
    color: #fff;
}
.c-btn--green:hover {
    background-color: #1b5e20;
}

.c-btn--red {
    background-color: #d32f2f;
    color: #fff;
}
.c-btn--red:hover {
    background-color: #b71c1c;
}

.c-btn--lightgrey {
    background-color: #e0e0e0;
    color: #333;
}
.c-btn--lightgrey:hover {
    background-color: #ccc;
}

/* ✅ FAB 버튼 */
.c-btn--fab {
    width: 56px;
    height: 56px;
    min-width: unset;
    min-height: unset;
    padding: 0;
    border-radius: 50%;
    background-color: #6200ee;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.c-btn--fab:hover {
    background-color: #5300d6;
}

/* ✅ 반응형 대응 */
@media (max-width: 1024px) {
    .c-btn {
        font-size: 13.5px;
        padding: 10px 14px;
        min-height: 36px;
    }
}

@media (max-width: 767px) {
    .c-btn {
        font-size: 13px;
        padding: 8px 12px;
        min-height: 32px;
    }
}

/* ✅ 아이콘 위치 */
.c-btn--icon-left .icon {
    display: inline-flex;
    margin-right: 6px;
    font-size: 16px;
    line-height: 1;
}

/* ✅ 아이콘 전용 버튼 (.c-btn--icon) */
.c-btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
}

.c-btn--icon .icon {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
}



@media (max-width: 1024px) {
    .c-btn--icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

@media (max-width: 767px) {
    .c-btn--icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ✅ Text 버튼 */
.c-btn--text {
    background-color: transparent;
    color: #6200ee;
    padding: 6px 8px;
    border: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.c-btn--text:hover {
    background-color: rgba(98, 0, 238, 0.1);
}

/* ✅ Block 버튼 */
.c-btn--block {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* ✅ 상태 */
.c-btn.is-disabled,
.c-btn:disabled {
    background-color: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid #ccc;
    opacity: 0.7;
}

.c-btn.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.c-btn.is-loading::after {
    content: "";
    position: absolute;
    right: 12px;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
