/* 인증 관련 스타일 */

/* ==================== 인증 섹션 기본 스타일 ==================== */
.auth-section {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
    margin-top: 1rem;
}

.auth-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

/* 인증 버튼 기본 스타일 */
.auth-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    min-width: 100px;
    justify-content: center;
}

.auth-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 로그인/회원가입 버튼 차별화 */
.signup-btn {
    background: var(--color-success);
}

.signup-btn:hover {
    background: #2d8f47;
}

.logout-btn {
    background: var(--color-error);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.logout-btn:hover {
    background: #c62d28;
}

/* 사용자 정보 표시 */
.user-info {
    padding: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    margin: 1rem auto;
    max-width: 400px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-profile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-email {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.9rem;
    text-align: center;
    padding: 0.5rem;
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius);
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.change-nickname-btn {
    background: var(--color-primary);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    flex: 1;
}

.change-nickname-btn:hover {
    background: var(--color-primary-hover);
}

/* ==================== 모달 스타일 ==================== */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4000;
    animation: fadeIn 0.3s ease;
}

.auth-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    background: var(--color-bg-card);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* 모달 헤더 */
.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-main);
}

.auth-modal-header h3 {
    margin: 0;
    color: var(--color-text);
    font-size: 1.2rem;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-light-text);
    padding: 0.25rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: var(--color-hover);
    color: var(--color-text);
}

/* 모달 본문 */
.auth-modal-body {
    padding: 0;
}

/* ==================== 폼 스타일 ==================== */
.auth-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-bg-card);
    color: var(--color-text);
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-group input.error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.1);
}

/* 제출 버튼 */
.auth-submit-btn {
    width: 100%;
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.auth-submit-btn:disabled {
    background: var(--color-disabled-bg);
    cursor: not-allowed;
    transform: none;
}

/* ==================== 소셜 로그인 ==================== */
.social-login {
    padding: 0 1.5rem 1.5rem;
}

.divider {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    background: var(--color-bg-card);
    padding: 0 1rem;
    color: var(--color-light-text);
    font-size: 0.9rem;
}

.social-btn {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--color-text);
    font-weight: 500;
}

.google-btn {
    border-color: #dadce0;
    background: #fff;
    color: #3c4043;
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #d2e3fc;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,.3);
}

.google-btn:disabled {
    background: #f5f5f5;
    color: #9aa0a6;
    cursor: not-allowed;
    border-color: #dadce0;
}

.google-btn i {
    color: #4285f4;
    font-size: 1rem;
}

/* 폼 전환 */
.auth-switch {
    text-align: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-main);
}

.auth-switch p {
    margin: 0 0 0.5rem 0;
    color: var(--color-light-text);
    font-size: 0.9rem;
}

.link-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.link-btn:hover {
    color: var(--color-primary-dark);
}

/* ==================== 피드백 메시지 ==================== */
.auth-feedback {
    padding: 0 1.5rem 1.5rem;
}

.loading {
    text-align: center;
    color: var(--color-primary);
    padding: 1rem;
    font-size: 0.9rem;
}

.loading i {
    margin-right: 0.5rem;
}

.error-message {
    background: #ffebee;
    color: var(--color-error);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid #ffcdd2;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.success-message {
    background: #e8f5e8;
    color: var(--color-success);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid #c8e6c9;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ==================== 애니메이션 ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==================== 반응형 디자인 ==================== */
@media (max-width: 768px) {
    .auth-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .auth-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        min-width: 90px;
    }
    
    .user-profile {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .user-email {
        text-align: center;
    }
    
    .auth-modal-header {
        padding: 1rem;
    }
    
    .auth-form {
        padding: 1rem;
    }
    
    .social-login {
        padding: 0 1rem 1rem;
    }
    
    .auth-switch {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .auth-buttons {
        flex-direction: column;
        align-items: center;
    }
      .auth-btn {
        width: 100%;
        max-width: 90px;
        height: auto;
    }
}

/* ==================== 폼 힌트 스타일 ==================== */
.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
    font-style: italic;
}

/* ==================== 다크모드 지원 ==================== */
[data-theme="dark"] .auth-modal {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .error-message {
    background: #3d1a1a;
    border-color: #5d1a1a;
}

[data-theme="dark"] .success-message {
    background: #1a3d1a;
    border-color: #1a5d1a;
}
