/* BotBook Component - Facebook-style Bot Profiles */

:root {
    /* BotBook specific CSS variables */
    --botbook-primary-blue: #4267B2;
    --botbook-bg-white: rgba(255, 255, 255, 0.95);
    --botbook-bg-glass: rgba(255, 255, 255, 0.08);
    --botbook-border-glass: rgba(255, 255, 255, 0.1);
    --botbook-text-primary: #1c1e21;
    --botbook-text-secondary: #65676b;
    --botbook-text-light: rgba(255, 255, 255, 0.8);
    --botbook-success: #00C851;
    --botbook-bg-light: #f7f8fa;
    --botbook-border-light: #e4e6ea;
    --botbook-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --botbook-radius: 20px;
    --botbook-radius-small: 12px;
    --botbook-gap: 25px;
    --botbook-gap-small: 15px;
}

/* Wrapper */
.S3-botbook-wrapper {
    /* Mobile-first: optimized for 320px devices */
    width: 100%;
    margin: 0;
    padding: 10px;
    background: transparent;
    box-sizing: border-box;
}

/* Header Section */
.S3-botbook-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--botbook-primary-blue);
    border-radius: var(--botbook-radius-small);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--botbook-border-glass);
}

.S3-botbook-title {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
}

.S3-botbook-description {
    margin: 0;
    font-size: 1rem;
    color: var(--botbook-text-light);
    line-height: 1.5;
}

/* Main container */
.S3-botbook-container {
    display: flex;
    flex-direction: column;
    gap: var(--botbook-gap);
    background: transparent;
    position: relative;
    width: 100%;
    max-width: 1180px;
}

/* Bot Icons Row */
.S3-botbook-icons {
    display: flex;
    justify-content: center;
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--botbook-radius-small);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--botbook-border-glass);
}

.S3-botbook-icons-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.S3-botbook-icon {
    width: 45px;
    /* mobile default */
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 2px solid transparent;
}

.S3-botbook-icon:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.S3-botbook-icon.active {
    border-color: var(--botbook-primary-blue);
    transform: scale(1.15);
}

.S3-botbook-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Facebook-style Profile */
.S3-botbook-profile {
    background: var(--botbook-bg-white);
    border-radius: var(--botbook-radius);
    overflow: hidden;
    box-shadow: var(--botbook-shadow);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.S3-botbook-profile-header {
    position: relative;
}

.S3-botbook-cover-photo {
    height: 120px;
    /* mobile default */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.S3-botbook-profile-avatar {
    /* Flow-friendly avatar for small screens — no absolute positioning */
    position: static;
    display: inline-block;
    width: 70px;
    height: 70px;
    margin-top: -36px;
    /* overlap the cover using negative margin */
    margin-left: 12px;
    border-radius: 50%;
    border: 3px solid white;
    overflow: hidden;
    background: white;
}

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

.S3-botbook-profile-info {
    padding: 30px 12px 15px;
    /* mobile default */
}

.S3-botbook-profile-meta {
    display: flex;
    align-items: center;
    gap: var(--botbook-gap-small);
    margin: 10px 0 20px 0;
}

.S3-botbook-launch-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--botbook-text-secondary);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 6px 12px;
    border-radius: var(--botbook-gap-small);
}

.S3-botbook-launch-date i {
    color: var(--botbook-primary-blue);
}

.S3-botbook-profile-name {
    margin: 0 0 5px 0;
    font-size: 1.4rem;
    /* mobile default */
    font-weight: bold;
    color: var(--botbook-text-primary);
}

.S3-botbook-profile-company {
    margin: 0 0 20px 0;
    color: var(--botbook-text-secondary);
    font-size: 1.1rem;
}

.S3-botbook-profile-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.S3-botbook-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--botbook-text-secondary);
    font-size: 0.9rem;
}

.S3-botbook-stat i {
    color: var(--botbook-primary-blue);
}

.S3-botbook-stat-number {
    font-weight: bold;
    color: var(--botbook-text-primary);
}

.S3-botbook-profile-actions {
    display: flex;
    flex-direction: column;
    gap: var(--botbook-gap-small);
}

.S3-botbook-trust-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--botbook-success);
    font-size: 0.9rem;
    font-weight: 600;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(0, 200, 81, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(0, 200, 81, 0.2);
}

.S3-botbook-action-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--botbook-gap-small);
}

.S3-botbook-download-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.S3-botbook-download {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 12px;
    background: #f6f7f9;
    color: var(--botbook-text-primary);
    border: 1px solid var(--botbook-border-light);
    opacity: 1;
    cursor: not-allowed;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 48px;
}

/* Icon sizing */
.S3-botbook-download i,
.S3-botbook-action-btn i {
    font-size: 20px;
    line-height: 1;
}

/* Disabled visual: subtle gray with lock */
.S3-botbook-download:not(.available),
.S3-botbook-action-btn:not(.available) {
    cursor: not-allowed;
    opacity: 0.9;
    background: linear-gradient(180deg, #f3f5f7, #eef1f4);
    color: #8a8f96;
    border-color: #e6eaee;
    filter: grayscale(10%);
}

.S3-botbook-download:not(.available):after,
.S3-botbook-action-btn:not(.available):after {
    content: '\1F512';
    /* lock glyph */
    margin-left: 8px;
    opacity: 0.7;
}

.S3-botbook-download.available {
    cursor: pointer;
    transform: translateZ(0);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    color: #fff;
}

.S3-botbook-download.available:hover {
    transform: translateY(-2px);
}

.S3-botbook-windows.available {
    background: linear-gradient(90deg, #0b84ff, #0078d4);
    border-color: rgba(0, 120, 212, 0.9);
}

.S3-botbook-mac.available {
    background: linear-gradient(90deg, #111111, #000000);
    border-color: rgba(0, 0, 0, 0.9);
}

.S3-botbook-ios.available {
    background: linear-gradient(90deg, #1488ff, #0066ff);
    border-color: rgba(0, 86, 210, 0.9);
}

.S3-botbook-android.available {
    background: linear-gradient(90deg, #00cc66, #00b04a);
    border-color: rgba(0, 176, 74, 0.9);
}

.S3-botbook-action-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.S3-botbook-action-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.S3-botbook-action-btn:hover:before {
    left: 100%;
}

.S3-botbook-primary {
    background: linear-gradient(135deg, var(--botbook-primary-blue) 0%, #365899 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 103, 178, 0.3);
}

.S3-botbook-primary:hover {
    background: linear-gradient(135deg, #365899 0%, #2d4373 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 103, 178, 0.4);
}

.S3-botbook-secondary {
    background: linear-gradient(135deg, #42b883 0%, #369870 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 184, 131, 0.3);
}

.S3-botbook-secondary:hover {
    background: linear-gradient(135deg, #369870 0%, #2d7a5d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 184, 131, 0.4);
}

.S3-botbook-verified-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--botbook-success);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 200, 81, 0.3);
}

/* Profile Content */
.S3-botbook-profile-content {
    padding: 0 12px 15px;
    /* mobile default */
    display: grid;
    grid-template-columns: 1fr;
    /* single column on small screens */
    gap: 15px;
}

.S3-botbook-about h3,
.S3-botbook-details h3 {
    margin: 0 0 15px 0;
    color: var(--botbook-text-primary);
    font-size: 1.3rem;
    font-weight: bold;
}

.S3-botbook-details {
    background: var(--botbook-bg-light);
    padding: 20px;
    border-radius: var(--botbook-radius-small);
    border: 1px solid var(--botbook-border-light);
}

.S3-botbook-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--botbook-border-light);
}

.S3-botbook-detail-item:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.S3-botbook-detail-label {
    font-weight: 600;
    color: var(--botbook-text-secondary);
    flex-shrink: 0;
    width: 30%;
}

.S3-botbook-detail-value {
    color: var(--botbook-text-primary);
    text-align: right;
    flex: 1;
}

.S3-botbook-table-note {
    background: rgba(66, 103, 178, 0.1);
    color: var(--botbook-primary-blue);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.S3-botbook-about-text {
    color: var(--botbook-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Best For inline block (moved from Details into About) */
.S3-botbook-bestfor-inline {
    display: block;
    margin-bottom: 12px;
}

.S3-botbook-bestfor-title {
    margin: 0 0 6px 0;
    color: var(--botbook-text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
}

.S3-botbook-bestfor-value {
    margin: 0;
    color: var(--botbook-text-primary);
    font-size: 1rem;
    line-height: 1.4;
}

.S3-botbook-features h4 {
    margin: 0 0 10px 0;
    color: var(--botbook-text-primary);
    font-size: 1.1rem;
}

.S3-botbook-features-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.S3-botbook-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(66, 103, 178, 0.1);
    border-radius: 20px;
    color: var(--botbook-primary-blue);
    font-size: 0.9rem;
}

/* Mobile-first defaults (small screens) */
.S3-botbook-wrapper {
    padding: 10px;
}

.S3-botbook-icon {
    width: 45px;
    height: 45px;
}

.S3-botbook-icons-wrapper {
    gap: 12px;
}

.S3-botbook-cover-photo {
    height: 120px;
}

.S3-botbook-profile-avatar {
    width: 70px;
    height: 70px;
    bottom: -20px;
    left: 15px;
}

.S3-botbook-profile-info {
    padding: 30px 12px 15px;
}

.S3-botbook-profile-content {
    grid-template-columns: 1fr;
    padding: 0 12px 15px;
    gap: 15px;
}

.S3-botbook-profile-name {
    font-size: 1.4rem;
}

.S3-botbook-detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.S3-botbook-detail-label {
    width: 100%;
}

.S3-botbook-detail-value {
    text-align: left;
}

/* Larger phones / small tablets */
@media (min-width: 481px) {
    .S3-botbook-wrapper {
        padding: 15px;
    }

    .S3-botbook-icon {
        width: 50px;
        height: 50px;
    }

    .S3-botbook-cover-photo {
        height: 150px;
    }

    .S3-botbook-profile-avatar {
        width: 100px;
        height: 100px;
        bottom: -30px;
        left: 20px;
    }

    .S3-botbook-profile-info {
        padding: 40px 20px 20px;
    }

    .S3-botbook-profile-name {
        font-size: 1.6rem;
    }
}

/* Tablet and up */
@media (min-width: 769px) {
    .S3-botbook-wrapper {
        padding: 20px;
    }

    .S3-botbook-icon {
        width: 60px;
        height: 60px;
    }

    .S3-botbook-icons-wrapper {
        gap: 20px;
    }

    .S3-botbook-cover-photo {
        height: 200px;
    }

    .S3-botbook-profile-avatar {
        width: 120px;
        height: 120px;
        bottom: -40px;
        left: 30px;
    }

    .S3-botbook-profile-info {
        padding: 50px 30px 30px;
    }

    .S3-botbook-profile-content {
        grid-template-columns: 1fr;
        padding: 0 30px 30px;
        gap: 30px;
    }

    .S3-botbook-profile-name {
        font-size: 2rem;
    }

    /* Show two features per row on tablets and larger */
    .S3-botbook-features-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 16px;
        align-items: start;
    }

    .S3-botbook-feature {
        justify-content: flex-start;
        padding: 10px 14px;
    }

    #s3_botProfileCardsContainer {
        width: 700px;
        margin: 0 auto;
    }
}