/* Link in Bio Public Page Styles */

:root {
    --bio-bg-color: #ffffff;
    --bio-text-color: #333333;
    --bio-accent-color: #1e87f0;
}

[data-theme="dark"] {
    --bio-bg-color: #1a1a1a;
    --bio-text-color: #f0f0f0;
    --bio-accent-color: #4db3ff;
}

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

.bio-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Widgets */
.bio-widget {
    margin: 0;
    /* Padding is controlled per widget */
}

/* Widget Block Backgrounds (full width) */
.bio-widget-has-bg {
    box-sizing: border-box;
}

/* Profile Widget */
.bio-profile-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Centered layout (default) */
.bio-profile-header--centered {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Left layout - image on left, text on right */
.bio-profile-header--left {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 20px;
}

.bio-profile-header--left .bio-profile-avatar {
    margin-bottom: 0;
    flex-shrink: 0;
}

.bio-profile-header--left .bio-profile-text {
    flex: 1;
}

/* Right layout - text on left, image on right */
.bio-profile-header--right {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 20px;
}

.bio-profile-header--right .bio-profile-avatar {
    margin-bottom: 0;
    flex-shrink: 0;
}

.bio-profile-header--right .bio-profile-text {
    flex: 1;
}

/* Spacing variations */
.bio-profile-header--compact {
    gap: 10px;
    margin-bottom: 15px;
}

.bio-profile-header--compact .bio-profile-avatar {
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
}

.bio-profile-header--compact .bio-profile-title {
    font-size: 1.25rem;
}

.bio-profile-header--compact .bio-profile-subtitle {
    font-size: 0.9rem;
    margin-top: 4px;
}

.bio-profile-header--loose {
    gap: 25px;
    margin-bottom: 40px;
}

.bio-profile-header--loose .bio-profile-avatar {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
}

.bio-profile-header--loose .bio-profile-title {
    font-size: 1.75rem;
}

.bio-profile-header--loose .bio-profile-subtitle {
    font-size: 1.1rem;
    margin-top: 8px;
}

.bio-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 2px solid var(--bio-bg-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, opacity 0.2s;
}

/* Contain image modifier - preserves aspect ratio */
.bio-profile-avatar--contain {
    object-fit: contain;
    max-width: 100%;
}

.bio-profile-avatar--no-border {
    border: none !important;
}

.bio-profile-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--bio-title-color, var(--bio-text-color));
}

.bio-profile-title-link {
    text-decoration: none;
    color: inherit;
}

.bio-profile-title-link:hover .bio-profile-title {
    opacity: 0.8;
}

.bio-profile-avatar-link {
    display: inline-block;
}

.bio-profile-avatar-link:hover .bio-profile-avatar {
    opacity: 0.9;
    transform: scale(1.02);
    transition: opacity 0.2s, transform 0.2s;
}

.bio-profile-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin: 5px 0 0 0;
    color: var(--bio-subtitle-color, var(--bio-text-color));
}

.bio-profile-text {
    display: flex;
    flex-direction: column;
}

/* Website Link */
.bio-website-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--bio-accent-color, #667eea);
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.bio-website-link:hover {
    opacity: 0.8;
}

.bio-website-link i {
    font-size: 0.8rem;
}

/* Link Widget */
.bio-button-link {
    display: block;
    font-family: var(--bio-font-button, var(--bio-font-body, inherit));
    /* Handle unified or individual padding */
    padding-top: var(--bio-button-padding-top, var(--bio-button-padding, 15px));
    padding-right: var(--bio-button-padding-right, var(--bio-button-padding, 20px));
    padding-bottom: var(--bio-button-padding-bottom, var(--bio-button-padding, 15px));
    padding-left: var(--bio-button-padding-left, var(--bio-button-padding, 20px));
    text-align: center;
    background: var(--bio-button-bg, var(--bio-bg-color));
    border-style: solid;
    border-color: var(--bio-button-border, rgba(0, 0, 0, 0.1));
    /* Use unified border-width when individual borders are not set */
    border-width: var(--bio-button-border-width, 1px);
    /* Override with individual border widths if set */
    border-top-width: var(--bio-button-border-top, var(--bio-button-border-width, 1px));
    border-right-width: var(--bio-button-border-right, var(--bio-button-border-width, 1px));
    border-bottom-width: var(--bio-button-border-bottom, var(--bio-button-border-width, 1px));
    border-left-width: var(--bio-button-border-left, var(--bio-button-border-width, 1px));
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: var(--bio-button-radius, 12px);
    text-decoration: none;
    color: var(--bio-button-text, var(--bio-text-color));
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.bio-button-link:hover {
    background: var(--bio-button-hover-bg, var(--bio-button-bg, var(--bio-bg-color)));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: var(--bio-button-text-hover, var(--bio-button-text, var(--bio-text-color)));
}

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

/* Instagram Widget */
.bio-instagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.bio-instagram-post {
    aspect-ratio: 1;
    background: #eee;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}

.bio-instagram-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.bio-instagram-post:hover img {
    transform: scale(1.05);
}

.bio-instagram-post.pinned::after {
    content: '\f08d';
    /* Needs FontAwesome */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    font-size: 12px;
}

/* Manual Instagram Followback Widget */
.bio-instagram-manual-grid {
    display: grid;
    gap: 4px;
}

.bio-instagram-manual-post {
    aspect-ratio: 1;
    background: #eee;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}

.bio-instagram-manual-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.bio-instagram-manual-post:hover img {
    transform: scale(1.05);
}

.bio-instagram-manual-caption {
    font-size: 0.85rem;
    margin-top: 6px;
    text-align: center;
    opacity: 0.9;
}

/* Content Widget */
.bio-content {
    line-height: 1.6;
}

.bio-content p {
    margin-bottom: var(--paragraph-spacing, 1em);
}

.bio-content p:last-child {
    margin-bottom: 0;
}

.bio-content a {
    color: var(--bio-accent-color);
}

/* Form Widget */
.bio-form-embed {
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
}

/* Heading Widget */
.bio-heading {
    margin: 0;
    color: var(--bio-text-color);
    font-family: var(--bio-font-title, inherit);
}

h1.bio-heading {
    font-size: 1.75rem;
    font-weight: 700;
}

h2.bio-heading {
    font-size: 1.4rem;
    font-weight: 600;
}

h3.bio-heading {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Heading Link */
.bio-heading-link {
    color: inherit;
    text-decoration: inherit;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.bio-heading-link:hover {
    color: var(--bio-heading-hover-color, var(--bio-accent-color, inherit));
    opacity: 0.9;
}

.bio-heading-link:active {
    color: var(--bio-heading-active-color, var(--bio-accent-color, inherit));
}

/* Underline on hover for heading links */
.bio-heading-link[data-underline-hover="true"]:hover {
    text-decoration: underline;
}

/* Text Block Widget */
.bio-text-block {
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--bio-text-color);
    opacity: 0.9;
}

/* Featured Image Widget */
.bio-featured-image {
    width: 100%;
}

.bio-featured-image img {
    width: 100%;
    display: block;
}

.bio-featured-caption {
    text-align: center;
    font-size: 0.85rem;
    margin: 8px 0 0 0;
    opacity: 0.7;
}

/* Carousel Widget */
.bio-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.bio-carousel-slides {
    position: relative;
}

.bio-carousel-slide {
    display: none;
}

.bio-carousel-slide.active {
    display: block;
}

.bio-carousel-slide img {
    width: 100%;
    display: block;
}

.bio-carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.bio-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s;
}

.bio-carousel-dot.active {
    background: white;
}

/* Carousel Caption */
.bio-carousel-caption {
    text-align: center;
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--bio-text-color);
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.03);
    margin: 0;
}

[data-theme="dark"] .bio-carousel-caption {
    background: rgba(255, 255, 255, 0.05);
}

/* Carousel Linked Images */
.bio-carousel-slide a {
    display: block;
    line-height: 0;
}

.bio-carousel-slide a img {
    transition: opacity 0.2s;
}

.bio-carousel-slide a:hover img {
    opacity: 0.9;
}

/* YouTube Widget */
.bio-youtube {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
}

.bio-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Spotify Widget */
.bio-spotify {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.bio-spotify iframe {
    width: 100%;
    border: 0;
    border-radius: 12px;
}

/* Social Icons Widget */
.bio-social-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.bio-social-icons a {
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bio-social-icons a:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Messenger Widget */
.bio-messenger {
    display: flex;
    gap: 10px;
}

.bio-messenger-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    color: white;
    transition: opacity 0.2s, transform 0.2s;
}

.bio-messenger-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.bio-messenger-whatsapp {
    background: #25D366;
}

.bio-messenger-telegram {
    background: #0088CC;
}

.bio-messenger-btn i {
    font-size: 1.25rem;
}

/* Countdown Widget */
.bio-countdown {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.bio-countdown-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.bio-countdown-timer {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.bio-countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bio-countdown-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.bio-countdown-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 4px;
}

/* FAQ Widget */
.bio-faq {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bio-faq-item {
    border-radius: 8px;
    overflow: hidden;
}

.bio-faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bio-text-color);
    cursor: pointer;
    transition: background 0.2s;
}

[data-theme="dark"] .bio-faq-question {
    background: rgba(255, 255, 255, 0.08);
}

.bio-faq-question:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .bio-faq-question:hover {
    background: rgba(255, 255, 255, 0.12);
}

.bio-faq-question i {
    font-size: 0.75rem;
    opacity: 0.5;
    transition: transform 0.3s;
}

.bio-faq-item.open .bio-faq-question i {
    transform: rotate(180deg);
}

.bio-faq-answer {
    display: none;
    padding: 14px 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.85;
}

.bio-faq-item.open .bio-faq-answer {
    display: block;
}

/* Divider Widget */
.bio-divider {
    margin: 10px auto;
}

/* Spacer Widget */
.bio-spacer {
    width: 100%;
}

/* RSS Feed Widget */
.bio-rss-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bio-rss-article {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    text-decoration: none;
    color: var(--bio-text-color);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

[data-theme="dark"] .bio-rss-article {
    background: rgba(255, 255, 255, 0.05);
}

.bio-rss-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .bio-rss-article:hover {
    background: rgba(255, 255, 255, 0.08);
}

.bio-rss-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.bio-rss-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bio-rss-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bio-rss-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--bio-text-color);
}

.bio-rss-description {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--bio-text-color);
    opacity: 0.75;
}

.bio-rss-date {
    font-size: 0.75rem;
    color: var(--bio-accent-color);
    opacity: 0.8;
    margin-top: auto;
}

/* RSS Cards Layout */
.bio-rss-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.bio-rss-cards .bio-rss-article {
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.bio-rss-cards .bio-rss-image {
    width: 100%;
    height: 100px;
    border-radius: 10px 10px 0 0;
}

.bio-rss-cards .bio-rss-content {
    padding: 12px;
}

.bio-rss-cards .bio-rss-description {
    display: none;
}

/* RSS Compact Layout */
.bio-rss-compact {
    gap: 8px;
}

.bio-rss-compact .bio-rss-article {
    padding: 10px 12px;
    align-items: center;
}

.bio-rss-compact .bio-rss-image {
    width: 44px;
    height: 44px;
    border-radius: 6px;
}

.bio-rss-compact .bio-rss-content {
    gap: 2px;
}

.bio-rss-compact .bio-rss-title {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bio-rss-compact .bio-rss-description {
    display: none;
}

.bio-rss-compact .bio-rss-date {
    font-size: 0.7rem;
}

/* HTML Block Widget */
.bio-html-block {
    width: 100%;
}

.bio-html-block img {
    max-width: 100%;
    height: auto;
}

.bio-html-block iframe {
    max-width: 100%;
}

/* Image + Text Row Widget */
.bio-image-text-row {
    width: 100%;
}

.bio-image-text-row img {
    max-width: 100%;
}

@media (max-width: 480px) {
    .bio-image-text-row {
        flex-direction: column !important;
    }

    .bio-image-text-row>div {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* Icon Widget */
.bio-icon-widget {
    width: 100%;
    padding: 10px 0;
}

.bio-icon-widget a {
    transition: opacity 0.2s ease;
}

.bio-icon-widget a:hover {
    opacity: 0.8;
}

.bio-icon-widget i {
    flex-shrink: 0;
}

/* Event Widget */
.bio-event {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: visible;
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

.bio-event-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.bio-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bio-event-content {
    padding: 16px;
}

.bio-event-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.bio-event-description {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.bio-event-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 6px;
}

.bio-event-meta i {
    width: 16px;
    text-align: center;
}

.bio-event-button {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--bio-accent, linear-gradient(135deg, #667eea, #764ba2));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.2s;
}

.bio-event-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.bio-event-calendar {
    margin-top: 16px;
}

.bio-event-calendar-dropdown {
    position: relative;
    display: inline-block;
}

.bio-event-calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bio-accent, #667eea);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.bio-event-calendar-btn:hover {
    opacity: 0.9;
}

.bio-event-calendar-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
}

.bio-event-calendar-dropdown.open .bio-event-calendar-menu {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

.bio-event-calendar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.bio-event-calendar-menu a:hover {
    background: #f5f5f5;
}

.bio-event-calendar-menu a i {
    width: 18px;
    text-align: center;
    color: #666;
}

/* Hero Image Widget */
.bio-hero-image {
    position: relative;
}

.bio-hero-title {
    font-family: var(--bio-font-title, inherit);
}

.bio-hero-button {
    border-radius: var(--bio-button-radius, 8px);
    transition: transform 0.2s, opacity 0.2s;
}

.bio-hero-button:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

/* Footer Widget */
.bio-footer {
    padding: 20px 0 0 0;
    margin-top: auto;
}

.bio-footer-social {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.bio-footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
}

.bio-footer-social-icon:hover {
    transform: scale(1.15);
    opacity: 0.8;
}

.bio-footer-copyright,
.bio-footer-custom,
.bio-footer-powered {
    margin-top: 6px;
    line-height: 1.5;
}

.bio-footer-powered a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bio-footer-powered a:hover {
    opacity: 0.8;
}

/* Remove bottom space when footer is the last widget */
.bio-widget-footer:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 20px;
}

/* Ensure bio-container doesn't have excessive bottom padding when footer is present */
.bio-container:has(.bio-widget-footer:last-child) {
    padding-bottom: 20px;
}