/* ========================================
   Thông Đắt CooKie - Linktree Clone
   Exact replica of linktr.ee style
   ======================================== */

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    color: #000;
    position: relative;
    overflow-x: hidden;
    background-color: #b0b0b0;
    padding: 20px;
}

/* ========================================
   Blurred Background (Linktree BLUR style)
   ======================================== */
.background-blur {
    max-width: 700px;
    margin: 24px auto;
    border-radius: 20px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #eceef1;
    overflow: hidden;
}

.blur-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(80px) saturate(1.5);
    opacity: 0.4;
    transform: scale(1.2);
}

/* ========================================
   Container
   ======================================== */
.container {
    width: 100%;
    max-width: 680px;
    padding: 48px 20px 32px;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border-radius: 40px;
    overflow: hidden;
}

/* ========================================
   Profile Section
   ======================================== */
.profile {
    text-align: center;
    margin-bottom: 24px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
    line-height: 1.4;
}

.profile-bio {
    font-size: 0.875rem;
    color: #000;
    line-height: 1.5;
    margin-bottom: 12px;
    opacity: 0.8;
}

/* ========================================
   Social Icons
   ======================================== */
.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #000;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-icon svg {
    width: 22px;
    height: 22px;
}

.social-icon:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

/* ========================================
   Links Section
   ======================================== */
.links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

/* Standard Link Item */
.link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    min-height: 56px;
    background: #ffffff;
    border-radius: 8px;
    padding: 4px 56px 4px 56px;
    text-decoration: none;
    color: #000;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    text-align: center;
}

.link-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.link-item:active {
    transform: scale(0.98);
}

.link-text {
    flex: 1;
    text-align: center;
    word-break: break-word;
    padding: 12px 0;
}

/* Three-dot menu button */
.link-menu {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
}

.link-menu:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.link-menu svg {
    pointer-events: none;
}

/* ========================================
   Featured Link (with banner image)
   ======================================== */
.link-featured {
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 24px;
}

.link-featured .featured-image {
    width: 100%;
    overflow: hidden;
}

.link-featured .featured-image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.link-featured:hover .featured-image img {
    transform: scale(1.02);
}

.link-featured .link-text {
    padding: 16px 56px 16px 16px;
    font-size: 0.95rem;
}

.link-featured .link-menu {
    bottom: 8px;
    top: auto;
    transform: none;
}

/* ========================================
   Footer - Linktree Logo
   ======================================== */
.footer {
    text-align: center;
    padding: 16px 0;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.linktree-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #000;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.linktree-logo:hover {
    opacity: 0.8;
}

/* ========================================
   Share/Copy Popup
   ======================================== */
.share-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-popup.active {
    opacity: 1;
    visibility: visible;
}

.share-popup-content {
    background: #fff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 680px;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

.share-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-size: 0.95rem;
    color: #000;
    font-family: inherit;
}

.share-popup-item:hover {
    opacity: 0.7;
}

.share-popup-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile {
    animation: fadeIn 0.4s ease-out;
}

.link-item {
    animation: fadeIn 0.4s ease-out both;
}

.link-item:nth-child(1) {
    animation-delay: 0.05s;
}

.link-item:nth-child(2) {
    animation-delay: 0.1s;
}

.link-item:nth-child(3) {
    animation-delay: 0.15s;
}

.link-item:nth-child(4) {
    animation-delay: 0.2s;
}

.link-item:nth-child(5) {
    animation-delay: 0.25s;
}

.link-item:nth-child(6) {
    animation-delay: 0.3s;
}

.link-item:nth-child(7) {
    animation-delay: 0.35s;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 40px 16px 24px;
    }

    .link-item {
        min-height: 52px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 32px 12px 20px;
    }

    .avatar {
        width: 80px;
        height: 80px;
    }

    .profile-name {
        font-size: 1.05rem;
    }

    .profile-bio {
        font-size: 0.825rem;
    }

    .social-icon svg {
        width: 20px;
        height: 20px;
    }

    .link-item {
        min-height: 48px;
        font-size: 0.9rem;
        border-radius: 8px;
        padding: 4px 48px 4px 48px;
    }

    .links {
        gap: 12px;
    }

    .link-featured {
        border-radius: 20px;
    }

    .link-featured .link-text {
        font-size: 0.9rem;
        padding: 14px 48px 14px 14px;
    }
}

/* Very small */
@media (max-width: 360px) {
    .container {
        padding: 24px 8px 16px;
    }

    .profile-bio {
        font-size: 0.78rem;
    }

    .link-item {
        font-size: 0.85rem;
        padding: 4px 44px 4px 44px;
    }
}