/**
 * 曼都曼喵大師頭膩診療間 - 分享彈窗樣式
 */

/* ==================== 分享彈窗 ==================== */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.share-modal.active {
    display: flex;
}

/* 遮罩層 */
.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* 彈窗內容 */
.share-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 1;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 關閉按鈕 */
.share-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.share-modal-close button {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-modal-close button:hover {
    background: #fff;
    transform: rotate(90deg);
}

/* 標題 */
.share-modal-content h2 {
    padding: 30px 20px 10px;
    text-align: center;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* 分享圖片容器 */
.share-image-container {
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px;
    border-radius: 15px;
}

.share-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* 分享標題樣式 */
.share-title {
    margin: 15px 0 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    color: #667eea;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    line-height: 1.6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 文字佔位樣式 */
.share-placeholder {
    width: 100%;
    max-width: 400px;
    min-height: 200px;
    padding: 40px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content h3 {
    color: #667eea;
    font-size: 20px;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.placeholder-content p {
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* 長壓提示 */
.long-press-tip {
    margin-top: 15px;
    padding: 10px;
    background: rgb(255 255 255 / 50%);
    border-radius: 8px;
    color: #bb0000;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    /* border: 1px solid #ffcccc; */
}

/* 分享提示訊息 - 顯示在「複製網址」按鈕正上方 */
.share-toast {
    position: absolute;
    bottom: 100%;          /* 在按鈕上方 */
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;    /* 與按鈕的間距 */
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInToast 0.3s ease-out;
    z-index: 10;
    pointer-events: none;
}

/* 小三角形提示 */
.share-toast::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.95);
}

.share-toast.fade-out {
    animation: fadeOutToast 0.3s ease-out forwards;
}

@keyframes fadeInToast {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOutToast {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 分享按鈕區 - 4個一排 */
.share-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 20px;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
}

.share-btn:active {
    transform: translateY(0);
}

/* 各分享按鈕的特定樣式 */
.share-btn.copy-link {
    background: transparent;
    color: #667eea;
}

.share-btn.copy-link .text {
    color: #fff;
}

.share-btn.facebook {
    background: transparent;
    color: #667eea;
}

.share-btn.facebook .text {
    color: #fff;
}

.share-btn.line {
    background: transparent;
    color: #667eea;
}

.share-btn.line .text {
    color: #fff;
}

.share-btn.threads {
    background: transparent;
    color: #667eea;
}

.share-btn.threads .text {
    color: #fff;
}

/* 圖標樣式 - 使用實際圖片 */
.share-btn .icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.share-btn .text {
    font-size: 13px;
}

/* ==================== 響應式設計 ==================== */
@media (max-width: 480px) {
    .share-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .share-modal-content h2 {
        font-size: 20px;
        padding: 20px 15px 10px;
    }

    .share-image-container {
        padding: 15px;
        margin: 15px;
    }

    .share-title {
        font-size: 14px;
        padding: 12px;
        margin: 12px 0 8px;
    }

    .share-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 15px;
    }

    .share-btn {
        padding: 12px 8px;
        font-size: 12px;
    }

    .share-btn .icon {
        width: 40px;
        height: 40px;
    }

    .share-btn .text {
        font-size: 11px;
    }

    .long-press-tip {
        font-size: 12px;
        padding: 8px;
    }
}

/* ==================== 動畫效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.share-modal-content {
    animation: fadeIn 0.3s ease-out;
}

/* ==================== 滾動條樣式 ==================== */
.share-modal-content::-webkit-scrollbar {
    width: 8px;
}

.share-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.share-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.share-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
