/* ============================================
   통일된 버튼 디자인 시스템
   - 형태 통일성: 높이, border-radius 통일
   - 모바일 터치 타겟: 최소 44px~48px
   - 가독성: 명암비 4.5:1 이상
   ============================================ */

/* ============================================
   기본 버튼 스타일 (Base Button)
   ============================================ */
.btn-base {
    /* 형태 통일성 */
    min-height: 48px; /* 모바일 터치 타겟 최소 크기 */
    border-radius: 12px; /* 통일된 모서리 둥글기 */
    
    /* 최소 너비 설정 (시각적 균형) */
    min-width: 120px;
    
    /* 패딩 및 간격 */
    padding: 14px 20px; /* 상하 14px, 좌우 20px */
    margin: 0; /* 기본 마진 제거 */
    
    /* 텍스트 스타일 */
    font-size: 1rem; /* 최소 16px */
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    
    /* 레이아웃 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* 아이콘과 텍스트 간격 */
    
    /* 인터랙션 */
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    touch-action: manipulation; /* 모바일 터치 최적화 */
    
    /* 접근성 */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* 버튼 그룹: 같은 행의 버튼들 간격 확보 */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px; /* 버튼 간 최소 12px 간격 (오터치 방지) */
    align-items: center;
}

.btn-group.vertical {
    flex-direction: column;
}

.btn-group.vertical .btn-base {
    width: 100%;
}

/* ============================================
   Primary 버튼 (강조 버튼)
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff; /* 명암비 4.5:1 이상 보장 */
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   Secondary 버튼 (보조 버튼)
   ============================================ */
.btn-secondary {
    background: #ffffff;
    color: #333333; /* 명암비 4.5:1 이상 보장 */
    border: 2px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.btn-secondary:active {
    transform: translateY(0) scale(0.98);
    background: #f0f0f0;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   Danger 버튼 (위험/삭제 액션)
   ============================================ */
.btn-danger {
    background: #dc3545;
    color: #ffffff; /* 명암비 4.5:1 이상 보장 */
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.35);
}

.btn-danger:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

/* ============================================
   Success 버튼 (성공/확인 액션)
   ============================================ */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff; /* 명암비 4.5:1 이상 보장 */
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.35);
}

.btn-success:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

/* ============================================
   소셜 로그인 버튼 (Google, Naver, Kakao)
   ============================================ */
.btn-social {
    min-height: 48px;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
    min-width: 120px;
    touch-action: manipulation;
}

/* Google 버튼 */
.btn-social.google {
    background: #ffffff;
    color: #333333;
    border-color: #e1e5e9;
}

.btn-social.google:hover {
    border-color: #4285f4;
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
    transform: translateY(-1px);
}

.btn-social.google:active {
    transform: translateY(0) scale(0.98);
}

/* Naver 버튼 */
.btn-social.naver {
    background: #03c75a;
    color: #ffffff;
    border-color: #03c75a;
}

.btn-social.naver:hover {
    background: #02b350;
    border-color: #02b350;
    box-shadow: 0 4px 12px rgba(3, 199, 90, 0.3);
    transform: translateY(-1px);
}

.btn-social.naver:active {
    transform: translateY(0) scale(0.98);
}

/* Kakao 버튼 */
.btn-social.kakao {
    background: #FEE500;
    color: #000000;
    border-color: #FEE500;
}

.btn-social.kakao:hover {
    background: #FDD835;
    border-color: #FDD835;
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.3);
    transform: translateY(-1px);
}

.btn-social.kakao:active {
    transform: translateY(0) scale(0.98);
}

/* 소셜 로그인 버튼 비활성화 */
.btn-social:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 소셜 로그인 아이콘 */
.btn-social img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ============================================
   Full Width 버튼 (전체 너비)
   ============================================ */
.btn-full {
    width: 100%;
    min-width: auto;
}

/* ============================================
   모바일 최적화
   ============================================ */
@media (max-width: 768px) {
    .btn-base {
        min-height: 48px; /* 모바일에서도 최소 48px 유지 */
        padding: 14px 18px; /* 좌우 패딩 약간 감소 */
        font-size: 1rem; /* 최소 16px 유지 */
    }
    
    .btn-group {
        gap: 10px; /* 모바일에서 간격 약간 감소 */
    }
    
    .btn-group.vertical {
        gap: 12px; /* 세로 배치 시 간격 유지 */
    }
}

@media (max-width: 480px) {
    .btn-base {
        min-height: 44px; /* 작은 화면에서 최소 44px */
        padding: 12px 16px;
        font-size: 0.95rem;
        min-width: 100px; /* 최소 너비 약간 감소 */
    }
    
    .btn-group {
        gap: 8px; /* 작은 화면에서 간격 최소화 */
    }
}

/* ============================================
   터치 디바이스 최적화
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .btn-base,
    .btn-social {
        min-height: 48px; /* 터치 디바이스에서 최소 48px 보장 */
    }
    
    .btn-base:active,
    .btn-social:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
}

/* ============================================
   접근성 개선
   ============================================ */
.btn-base:focus,
.btn-social:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.btn-base:focus:not(:focus-visible),
.btn-social:focus:not(:focus-visible) {
    outline: none;
}

