/* Reset & Basic Setup */
body.uag-bio-body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #b3b3b3;
    color: #1a1a1a;
    /* Improvement: Makes fonts look sharper on MacOS/iOS */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Layout */
.bio-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 15px;
    box-sizing: border-box;
}

/* Card Container */
.bio-card {
    background-color: #ffffff;
    width: 100%;
    max-width: 600px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    position: relative;
}

/* Share Button (Top Right) */
.bio-share-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: #ffffff;
    color: #79242f;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bio-share-btn:hover,
.bio-share-btn:focus {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    /* Remove default browser outline */
    outline: none;
}

.bio-share-btn svg {
    width: 22px;
    height: 22px;
    /* Improvement: Prevents icon squashing */
    flex-shrink: 0;
}

/* Header */
.bio-card-header {
    width: 100%;
    height: 130px;
    background-color: #79242f;
}

.bio-content-padding {
    padding: 0 30px 40px 30px;
    text-align: center;
}

/* Profile & Text */
.bio-profile-wrapper {
    width: 110px;
    height: 110px;
    margin: -55px auto 15px;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.bio-profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.bio-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: #1a1a1a;
}

.bio-description {
    font-size: 1rem;
    color: #666;
    margin: 0 0 30px;
    line-height: 1.5;
}

/* Social & Links */
.bio-social-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 35px;
}

.social-icon-link {
    color: #79242f;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
}

.social-icon-link:hover,
.social-icon-link:focus {
    transform: translateY(-3px);
    opacity: 0.8;
}

.social-icon-link svg {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.bio-links-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Standard Card */
.bio-link-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #ffffff;
    padding: 18px 22px;
    border-radius: 12px;
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 1.05rem;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.bio-link-card:hover,
.bio-link-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(121, 36, 47, 0.15);
    border-color: #79242f;
    background-color: #fafafa;
    outline: none;
}

.bio-icon-left {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #79242f;
    margin-right: 12px;
}

.bio-icon-left svg {
    width: 24px;
    height: 24px;
    /* Important for visual consistency */
    flex-shrink: 0;
}

/* Featured Card Override */
.bio-links-list .bio-link-card.bio-featured-link {
    display: flex;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden;
    gap: 0;
}

.featured-img-container {
    width: 100%;
    height: auto;
    background-color: #eee;
    border-bottom: 1px solid #eee;
    display: block;
}

.featured-img {
    width: 100%;
    height: auto;
    display: block;
}

.featured-label-row {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    /* Ensures it takes full width */
    width: 100%;
    /* Prevents padding from breaking width */
    box-sizing: border-box;
}

.bio-featured-link:hover .featured-img {
    opacity: 0.95;
}

/* Footer */
.bio-footer {
    margin-top: 40px;
    font-size: 0.8rem;
    color: #999;
}

/* Modal Styles */
.bio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    /* Improvement: Subtle background blur */
    backdrop-filter: blur(2px);
}

.bio-modal.active {
    display: flex;
    opacity: 1;
}

.bio-modal-content {
    background: white;
    padding: 35px 25px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 340px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Clean Close Button */
.bio-modal-close {
    background: transparent;
    border: none;
    outline: none;
    position: absolute;
    top: 10px;
    right: 10px;
    /* Slightly larger for better touch target */
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s ease;
    /* Improvement: Generous click area for mobile */
    padding: 10px;
}

.bio-modal-close:hover {
    color: #79242f;
    background: transparent;
}

.modal-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: #79242f;
    font-size: 1.2rem;
}

/* Centered QR */
.qr-code-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.qr-code-wrapper img {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* Copy Row (Grey Box with Icon) */
.url-copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f4f4f4;
    border: 1px solid #ddd;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.url-text {
    font-size: 0.85rem;
    color: #555;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.icon-copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #79242f;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: transform 0.1s;
}

.icon-copy-btn:active {
    transform: scale(0.9);
}

.icon-copy-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Action Buttons Row */
.share-actions-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    background-color: #79242f;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.action-btn:hover {
    background-color: #5a1a23;
}

.action-btn svg {
    width: 18px;
    height: 18px;
    /* Ensure margin here */
    margin-right: 6px;
    flex-shrink: 0;
}

/* Alternative style for QR button */
.action-btn.outline {
    background-color: transparent;
    border: 1px solid #79242f;
    color: #79242f;
}

.action-btn.outline:hover {
    background-color: #fceceebd;
}

/* Responsive */
@media (max-width: 480px) {
    .bio-wrapper {
        padding: 40px 15px;
    }

    .bio-title {
        font-size: 1.4rem;
    }

    .featured-img-container {
        min-height: 80px;
    }
}

/* JS Interaction States */

/* Copied State (Green) */
.is-copied {
    background-color: #4caf50 !important;
    color: #ffffff !important;
    border-color: #4caf50 !important;
}

/* Specifically for the small icon button when copied */
.icon-copy-btn.is-copied {
    background-color: transparent !important;
    color: #4caf50 !important;
    transform: scale(1.1);
}

/* Simple Loading Spinner */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Darker spinner for outline buttons */
.action-btn.outline .spinner {
    border: 2px solid rgba(121, 36, 47, 0.2);
    border-top-color: #79242f;
}