/* SNS 공유 버튼 스타일 */

/* 컨테이너 */
.sns-share-buttons {
    display: flex;
    gap: 6px;
    margin: 20px 0;
    flex-wrap: wrap;
    align-items: center;
}

/* 기본 버튼 스타일 */
.sns-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    
    /* 접근성: 최소 터치 영역 */
    min-height: 44px;
    min-width: 44px;
}

/* 아이콘 전용 모드 */
[data-style="icon"] .sns-btn {
    background-color: inherit;
    border-radius: 50%;
    width: 45px;
    height: 45px;
}

/* 아이콘+텍스트 모드 */
[data-style="icon-text"] .sns-text {
    margin-left: 8px;
}

/* 포커스 스타일 (접근성) */
.sns-btn:focus {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* 호버 효과 */
@media (hover: hover) {
    .sns-btn:hover {
        opacity: 0.9;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
}

/* 아이콘 스타일 */
.sns-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-style="icon"] .sns-icon {
    width: 40px;
    height: 40px;
}

/* 플랫폼별 색상 */
.sns-facebook { 
    background-color: #1877f2; 
    color: white; 
}
.sns-facebook:hover { 
    background-color: #166fe5; 
}

.sns-twitter { 
    background-color: #1da1f2; 
    color: white; 
}
.sns-twitter:hover { 
    background-color: #1a91da; 
}

.sns-kakaotalk { 
    background-color: #fee500; 
    color: #3c1e1e; 
}
.sns-kakaotalk:hover { 
    background-color: #fdd835; 
}

.sns-naver { 
    background-color: #03c75a; 
    color: white; 
}
.sns-naver:hover { 
    background-color: #02b351; 
}

.sns-telegram { 
    background-color: #0088cc; 
    color: white; 
}
.sns-telegram:hover { 
    background-color: #007bb5; 
}

.sns-copy { 
    background-color: #6c757d; 
    color: white; 
}
.sns-copy:hover { 
    background-color: #5a6268; 
}

/* 복사 성공 상태 */
.sns-copy-success {
    background-color: #28a745 !important;
    animation: copySuccess 0.6s ease-out;
}

@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}


.sns-icon-facebook::before {
    content: "";
    display: block;
    width: 33px;
    height: 33px;
    background-image:url(../img/facebook-black.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
[data-theme="dark"] .sns-icon-facebook::before {
    background-image:url(../img/facebook-white.svg);
}
.sns-icon-twitter::before {
    content: "";
    display: block;
    width: 33px;
    height: 33px;
    background-image:url(../img/twitter-black.svg); 
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
[data-theme="dark"] .sns-icon-twitter::before {
    background-image:url(../img/twitter-white.svg);
}   
.sns-icon-kakaotalk::before {
    content: "";
    display: block;
    width: 30px;
    height: 30px;
    background-image:url(../img/kakaotalk-black.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
[data-theme="dark"] .sns-icon-kakaotalk::before {
    background-image:url(../img/kakaotalk-white.svg);
}   
.sns-icon-naver::before {
    content: "";
    display: block;
    width: 26px;
    height: 26px;
    background-image: url(../img/naver-black.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
[data-theme="dark"] .sns-icon-naver::before {
    background-image: url(../img/naver-white.svg);
}   
.sns-icon-telegram::before {
    content: "";
    display: block;
    width: 25px;
    height: 25px;
    background-image: url(../img/telegram-black.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
[data-theme="dark"] .sns-icon-telegram::before {
    background-image: url(../img/telegram-white.svg);
}   
.sns-icon-copy::before {
    content: "";
    display: block;
    width: 28px;
    height: 28px;
    background-image:url(../img/copy-link-icon.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
[data-theme="dark"] .sns-icon-copy::before {
    background-image:url(../img/copy-link-icon-white.png);
}
/* 툴팁 스타일 */
.sns-btn[data-tooltip] {
    position: relative;
}

.sns-btn[data-tooltip]:hover::after,
.sns-btn[data-tooltip]:focus::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}


.sns-btn[data-tooltip]:hover::before,
.sns-btn[data-tooltip]:focus::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

/* 토스트 메시지 */
.sns-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 9999;
    animation: snsToastShow 2.5s ease-out;
}

.sns-toast-success {
    background: rgba(40, 167, 69, 0.9);
}

.sns-toast-error {
    background: rgba(220, 53, 69, 0.9);
}

@keyframes snsToastShow {
  0%   { opacity: 0; bottom: 10px; }
  10%  { opacity: 1; bottom: 20px; }
  80%  { opacity: 1; bottom: 20px; }
  90%  { opacity: 0.6; bottom: 22px; }
  95%  { opacity: 0.3; bottom: 25px; }
  100% { opacity: 0; bottom: 30px; }
}

/* 반응형 디자인 */
@media (max-width: 600px) {
    .sns-share-buttons {
        gap: 6px;
        justify-content: space-around;
    }
.sns-btn:first-child[data-tooltip]:hover::after {
  left: 0;
  transform: translateX(0);
}

.sns-btn:last-child[data-tooltip]:hover::after {
  left: auto;
  right: 0;
  transform: translateX(0);
}    
    .sns-btn {
        min-width: 40px;
        min-height: 40px;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    [data-style="icon"] .sns-btn {
        padding: 8px;
    }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .sns-btn {
        border: 2px solid currentColor;
    }
    
    .sns-btn:focus {
        outline: 3px solid currentColor;
    }
}

/* 애니메이션 감소 모드 */
@media (prefers-reduced-motion: reduce) {
    .sns-btn {
        transition: none;
    }
    
    .sns-btn:hover {
        transform: none;
    }
    
    @keyframes copySuccess {
        0%, 100% { transform: none; }
    }
    
    .sns-toast {
        animation: none;
        opacity: 1;
    }
}

/* 프린트 시 숨김 */
@media print {
    .sns-share-buttons {
        display: none;
    }
}