/* ========================================
   IGCert 팹메뉴(Floating Action Button) 스타일
   작성일: 2025년 9월 12일
   ======================================== */

/* 팹메뉴 컨테이너 */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 15px;
}

/* 메인 팹 버튼 */
.fab-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fab-main::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.fab-main:hover::before {
    width: 100px;
    height: 100px;
}

.fab-main:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.fab-main:active {
    transform: scale(0.95);
}

/* 팹 메뉴 아이템들 */
.fab-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 개별 팹 아이템 */
.fab-item {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    color: #333;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}

.fab-item:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: #f97316;
    color: #f97316;
}

/* 팹 아이템 툴팁 */
.fab-item::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.fab-item::before {
    content: "";
    position: absolute;
    right: 52px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.fab-item:hover::after,
.fab-item:hover::before {
    opacity: 1;
    visibility: visible;
}

/* 팹 아이템 애니메이션 */
.fab-menu.active .fab-item:nth-child(1) {
    animation: fadeInUp 0.3s ease forwards;
    animation-delay: 0.05s;
}

.fab-menu.active .fab-item:nth-child(2) {
    animation: fadeInUp 0.3s ease forwards;
    animation-delay: 0.1s;
}

.fab-menu.active .fab-item:nth-child(3) {
    animation: fadeInUp 0.3s ease forwards;
    animation-delay: 0.15s;
}

.fab-menu.active .fab-item:nth-child(4) {
    animation: fadeInUp 0.3s ease forwards;
    animation-delay: 0.2s;
}

.fab-menu.active .fab-item:nth-child(5) {
    animation: fadeInUp 0.3s ease forwards;
    animation-delay: 0.25s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 메인 버튼 아이콘 회전 */
.fab-main .fab-icon {
    transition: transform 0.3s ease;
}

.fab-main.active .fab-icon {
    transform: rotate(45deg);
}

/* 특별 기능 버튼 스타일 */
.fab-item.fab-top {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
}

.fab-item.fab-top:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: scale(1.15) translateY(-3px);
}

.fab-item.fab-call {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
}

.fab-item.fab-call:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.15);
    animation: ring 0.5s ease;
}

@keyframes ring {
    0%, 100% { transform: scale(1.15) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-10deg); }
    75% { transform: scale(1.15) rotate(10deg); }
}

.fab-item.fab-chat {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #fff;
    border: none;
}

.fab-item.fab-chat:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    transform: scale(1.15);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .fab-container {
        bottom: 20px;
        right: 20px;
    }
    
    .fab-main {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
    
    .fab-item {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
    
    .fab-item::after,
    .fab-item::before {
        display: none;
    }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    .fab-item {
        background: #1f2937;
        color: #e5e7eb;
        border-color: #374151;
    }
    
    .fab-item:hover {
        background: #374151;
        color: #f97316;
        border-color: #f97316;
    }
    
    .fab-item::after {
        background: #e5e7eb;
        color: #1f2937;
    }
    
    .fab-item::before {
        border-color: transparent transparent transparent #e5e7eb;
    }
}

/* 접근성 개선 */
.fab-main:focus,
.fab-item:focus {
    outline: 3px solid #f97316;
    outline-offset: 3px;
}

/* 스크롤 시 숨김/표시 */
.fab-container.hide {
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.fab-container.show {
    transform: translateY(0);
    opacity: 1;
    transition: all 0.3s ease;
}