/**
 * 프론트엔드 스타일
 */

.klp-login-form {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
}

/* SNS 로그인 섹션 */
.klp-sns-login-section {
    margin: 30px 0;
}

.klp-sns-title {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
}

.klp-sns-title::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 0;
}

.klp-sns-title-text {
    position: relative;
    background: #fff;
    padding: 0 15px;
    color: #666;
    font-size: 14px;
    z-index: 1;
}

/* 소셜 아이콘 컨테이너 */
.klp-social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

/* 원형 소셜 아이콘 버튼 */
.klp-social-icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    background: transparent !important;
    pointer-events: auto;
}

.klp-social-icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.klp-social-icon-btn:active {
    transform: scale(0.95);
}

/* 소셜 아이콘 이미지 */
.klp-social-icon-btn .klp-social-icon {
    width: 50px;
    height: 50px;
    display: block;
    pointer-events: none;
    object-fit: cover;
    border-radius: 50%;
}

/* 배경색 완전 제거 (이미지에 배경이 포함되어 있음) */
.klp-icon-kakao,
.klp-icon-naver,
.klp-icon-google {
    background-color: transparent !important;
    background: none !important;
}

/* 기존 버튼 스타일 (하위 호환성) */
.klp-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.klp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s;
    text-decoration: none;
    color: #fff;
}

.klp-btn:hover {
    opacity: 0.9;
}

.klp-btn:active {
    opacity: 0.8;
}

.klp-btn-kakao {
    background-color: #FEE500;
    color: #000;
}

.klp-btn-naver {
    background-color: #03C75A;
}

.klp-btn-google {
    background-color: #4285F4;
}

.klp-loading {
    text-align: center;
    padding: 20px;
}

.klp-error {
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    margin-top: 10px;
}

.klp-logged-in {
    text-align: center;
    padding: 20px;
}

.klp-logout-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #dc3545;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.klp-logout-btn:hover {
    background-color: #c82333;
}

/* 일반 로그인/회원가입 폼 */
.klp-login-form,
.klp-register-form {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.klp-login-form-inner,
.klp-register-form-inner {
    margin-bottom: 20px;
}

.klp-login-form-inner h3,
.klp-register-form-inner h3 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.klp-form-group {
    margin-bottom: 15px;
}

.klp-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.klp-form-group .required {
    color: #dc3545;
}

.klp-form-group input[type="text"],
.klp-form-group input[type="email"],
.klp-form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.klp-form-group input[type="text"]:focus,
.klp-form-group input[type="email"]:focus,
.klp-form-group input[type="password"]:focus {
    outline: none;
    border-color: #2271b1;
}

.klp-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.klp-form-group input[type="checkbox"] {
    margin-right: 5px;
}

.klp-btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.klp-btn-primary:hover {
    background-color: #135e96;
}

.klp-btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.klp-form-links {
    margin-top: 15px;
    text-align: center;
}

.klp-form-links a {
    color: #2271b1;
    text-decoration: none;
}

.klp-form-links a:hover {
    text-decoration: underline;
}

/* 액션 버튼 (계정 찾기, 비밀번호 찾기, 회원가입) */
.klp-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.klp-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background-color: #000000 !important;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-width: 100px;
}

.klp-action-btn:hover {
    background-color: #333333 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #ffffff !important;
    text-decoration: none;
}

.klp-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.klp-action-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: #ffffff !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
}

.klp-action-btn span {
    white-space: nowrap;
    color: #ffffff !important;
}

.klp-action-btn svg {
    fill: #ffffff !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
}

.klp-action-btn svg path {
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

/* 체크박스 레이블 스타일 */
.klp-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.klp-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* 필드 에러 메시지 */
.klp-field-error {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 20px;
}

.klp-field-error:empty {
    display: none;
}

/* 폼 옵션 레이아웃 */
.klp-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.klp-find-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.klp-find-link {
    color: #666;
    text-decoration: none;
    font-size: 13px;
}

.klp-find-link:hover {
    color: #2271b1;
    text-decoration: underline;
}

.klp-link-separator {
    color: #ddd;
}

.klp-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.klp-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.klp-divider span {
    position: relative;
    background: #fff;
    padding: 0 15px;
    color: #666;
}

.klp-success {
    padding: 15px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    margin-top: 10px;
}

/* 사용자 메뉴 (상단 로그인/로그아웃) */
.klp-user-menu {
    display: block;
    width: 100%;
    text-align: right;
}

.klp-user-menu-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

/* 헤더용 텍스트 로그인/회원가입/로그아웃 링크 */
.klp-auth-links {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px !important;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    -webkit-text-fill-color: #ffffff !important;
}

.klp-auth-links a,
.klp-auth-links a:link,
.klp-auth-links a:active,
.klp-auth-links a:visited,
.klp-auth-links span,
.klp-auth-link {
    display: inline-block !important;
    color: #ffffff !important;
    text-decoration: none !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.klp-auth-links a:visited,
.klp-auth-link:visited {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.klp-auth-links a:hover,
.klp-auth-links a:focus,
.klp-auth-link:hover,
.klp-auth-link:focus {
    color: #ffffff !important;
    opacity: 0.8;
    text-decoration: none !important;
    -webkit-text-fill-color: #ffffff !important;
}

.klp-auth-separator {
    display: inline-block !important;
    margin: 0 2px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* 사용자 메뉴 드롭다운 - 아이콘 기준 오른쪽 정렬 */
.klp-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: stretch;
}

.klp-user-dropdown-item {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: #333333;
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.klp-user-menu-inner.klp-open .klp-user-dropdown {
    display: flex;
}

.klp-user-dropdown-item:hover {
    background-color: #f5f5f5;
}

.klp-user-dropdown-logout {
    border-top: 1px solid #eeeeee;
    margin-top: 4px;
    padding-top: 12px;
}

/* 사서함 번호 표시 */
.klp-user-dropdown-mailbox {
    padding: 12px 16px;
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 4px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.klp-mailbox-label {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #666666;
    line-height: 1.5;
}

.klp-mailbox-number {
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    color: #d4a574;
    letter-spacing: 0.5px;
    line-height: 1.5;
}

/* 아이콘 버튼 스타일 */
.klp-account-icon,
.account-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #d4a574;
    background: linear-gradient(135deg, #d4a574 0%, #c4956b 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    /* 텍스트 숨기기 */
    font-size: 0;
    line-height: 0;
    overflow: hidden;
}

.klp-account-icon *,
.account-icon * {
    font-size: 0;
}

.klp-account-icon:hover,
.account-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #e0b584 0%, #d4a574 100%);
}

.klp-login-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #d4a574;
    background: linear-gradient(135deg, #d4a574 0%, #c4956b 100%);
    border: none;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.klp-login-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #e0b584 0%, #d4a574 100%);
}

/* SVG 아이콘 스타일 */
.klp-user-icon {
    width: 22px;
    height: 22px;
}

/* 로그인 후 아이콘 - 흰색 아이콘 */
.klp-account-icon .klp-user-icon,
.account-icon svg,
.account-icon .klp-user-icon {
    color: white !important;
    fill: white !important;
    stroke: white !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    width: 22px !important;
    height: 22px !important;
    display: block !important;
}

/* 텍스트 숨기기 - 안녕하세요 등 */
.klp-user-menu p,
.klp-user-menu .wd-header-text,
.wd-header-text p {
    display: none !important;
}

/* klp-user-menu 옆의 텍스트 숨기기 */
.whb-column .wd-header-text p,
.whb-col-right .wd-header-text p {
    display: none !important;
}

/* account-icon 내부 텍스트 숨기기 */
.account-icon,
.klp-account-icon {
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
}

.account-icon::before,
.account-icon::after,
.klp-account-icon::before,
.klp-account-icon::after {
    display: none !important;
}

/* account-icon 내부의 모든 텍스트 노드 숨기기 */
.account-icon > *:not(svg):not(.klp-user-icon),
.klp-account-icon > *:not(svg):not(.klp-user-icon) {
    display: none !important;
    visibility: hidden !important;
}

/* 로그인 전 아이콘 - 갈색 배경, 흰색 아이콘 */
.klp-login-icon {
    background: linear-gradient(135deg, #d4a574 0%, #c4956b 100%);
}

.klp-login-icon .klp-user-icon {
    color: white;
}

.klp-login-icon .klp-user-icon circle,
.klp-login-icon .klp-user-icon path {
    stroke: white;
    fill: none;
}

/* 헤더에 자동 출력 시 스타일 */
.klp-user-menu.klp-auto-inserted {
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 9999;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

@media (max-width: 768px) {
    .klp-user-menu.klp-auto-inserted {
        position: relative;
        top: auto;
        right: auto;
        display: block;
        text-align: right;
        margin: 10px;
    }
}

/* 헤더 내부에 배치할 때 오른쪽 정렬 */
.klp-header-menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-left: auto;
}

.klp-header-menu .klp-user-menu {
    margin-left: 0;
}

/* 사서함 번호 쇼트코드 스타일 */
.klp-mailbox-number-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.klp-mailbox-number-display .klp-mailbox-label {
    color: #666666;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.klp-mailbox-number-display .klp-mailbox-number {
    color: #d4a574;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 16px;
    line-height: 1.5;
}

.klp-mailbox-number-empty {
    display: inline-block;
    color: #999999;
    font-size: 13px;
    font-style: italic;
}

/* 헤더/푸터용 스타일 */
header .klp-mailbox-number-display,
footer .klp-mailbox-number-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

header .klp-mailbox-number-display .klp-mailbox-number,
footer .klp-mailbox-number-display .klp-mailbox-number {
    font-size: 14px;
}
