:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --card-bg: #1C1C1E;
    --card-hover: #2C2C2E;
    --accent-gradient: linear-gradient(135deg, #833AB4, #FD1D1D, #FCB045);
    /* Instagram-ish */
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --blur-amount: 12px;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Profile Header */
.profile-header {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 30px;
}

.avatar-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #333;
}

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

.profile-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.verified-badge {
    width: 20px;
    height: 20px;
}

.bio {
    font-size: 0.9rem;
    color: #888;
    margin-top: 10px;
}

/* Links List */
.links-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.link-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s, background-color 0.2s;
    cursor: pointer;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    background-color: var(--card-hover);
    transform: scale(1.02);
}

.link-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 15px;
}

.link-content {
    flex: 1;
}

.link-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 3px;
    display: block;
}

.link-subtitle {
    font-size: 0.8rem;
    color: #888;
}

.lock-icon-small {
    margin-left: 10px;
    color: #888;
}

/* Footer */
.footer {
    margin-top: 50px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: #444;
}

.footer a {
    color: #666;
    text-decoration: none;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-content {
    background-color: #1C1C1E;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    width: 80%;
    max-width: 350px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay.active .overlay-content {
    transform: scale(1);
}

.lock-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #ffffff;
}

.overlay-content h2 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.overlay-content p {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 30px;
    line-height: 1.5;
}

.continue-btn {
    background-color: #ffffff;
    color: #000000;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.2s;
}

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

.continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
}

.hidden {
    display: none;
    /* fallback */
    opacity: 0;
    pointer-events: none;
}

/* CSS for Link Background Images (Banners) */
.link-card.has-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* Fallback aspect ratio (2.5:1) until JS loads the image */
    aspect-ratio: 2.5 / 1;

    display: flex;
    flex-direction: column;
    /* User request: Move text to the bottom */
    justify-content: flex-end;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Remove default card padding so overlay hits the edges */
    padding: 0;

    /* Ensure relative positioning for the pseudo-element overlay */
    position: relative;
    overflow: hidden;

    transition: all 0.3s ease;

    /* Text Shadow for readability */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* Pseudo-element Overlay */
.link-card.has-bg-image::after {
    content: '';
    position: absolute;
    /* Bleed significantly to ensure full coverage including borders */
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    /* Default: Light/Transparent overlay (shows image clearly) */
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
    transition: background 0.3s ease;
}

/* Hover: Dark overlay (dim image) */
.link-card.has-bg-image:hover::after {
    background: rgba(0, 0, 0, 0.6);
}

/* Ensure content is above the overlay and at the bottom */
.link-card.has-bg-image .link-content {
    z-index: 2;
    position: relative;
    /* User Requested change: Stop taking full height so justify-content: flex-end works */
    flex: 0;
    width: 100%;
    /* Optional: Center text horizontally if not already */
    text-align: center;
    /* Add padding back since we removed it from the card */
    padding: 15px;
}

.link-card.has-bg-image .link-thumbnail {
    z-index: 2;
    position: relative;
}

.link-card.has-bg-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Remove the old img styles since we reverted script.js */
.link-bg-image {
    display: none;
}

/* Top-Left Icon Style */
.link-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    /* User request: Make icon tiny larger (24 -> 32px) */
    width: 32px;
    height: 32px;
    object-fit: contain;
    z-index: 10;


}