/* ==========================================
   For You - Personalized Recommendations Page
   ========================================== */

.aidb-fy {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 0 36px;
}

/* Profile Header */
.aidb-fy-profile {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 28px;
    color: #fff;
}

.aidb-fy-profile-inner {
    max-width: 100%;
}

.aidb-fy-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
}

.aidb-fy-profile-summary {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 12px;
    opacity: 0.92;
}

.aidb-fy-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.aidb-fy-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.aidb-fy-profile-meta {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.65;
}

/* Section */
.aidb-fy-section {
    margin-bottom: 30px;
}

.aidb-fy-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aidb-fy-section-icon {
    font-size: 1.2rem;
}

/* Grid (for post cards) */
.aidb-fy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Post Card */
.aidb-fy-card {
    display: block;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}

.aidb-fy-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    text-decoration: none !important;
}

.aidb-fy-card * {
    text-decoration: none !important;
}

.aidb-fy-card-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f5f5f5;
}

.aidb-fy-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aidb-fy-card-body {
    padding: 14px 16px;
}

.aidb-fy-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.aidb-fy-card-cat {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #555;
}

.aidb-fy-cat-paper {
    background: #eaeaea;
    color: #666;
}

.aidb-fy-cat-brief {
    background: #f0f0f0;
    color: #555;
}

.aidb-fy-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aidb-fy-card-excerpt {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aidb-fy-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.aidb-fy-card-date {
    font-size: 0.75rem;
    color: #999;
}

.aidb-fy-card-match {
    font-size: 0.7rem;
    font-weight: 600;
    color: #555;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* List (for papers & briefs) */
.aidb-fy-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aidb-fy-list-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 14px 18px;
    transition: box-shadow 0.2s;
}

.aidb-fy-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.aidb-fy-list-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 6px;
}

.aidb-fy-list-item-title a {
    color: inherit;
    text-decoration: none;
}

.aidb-fy-list-item-title a:hover {
    color: #333;
}

.aidb-fy-list-item-authors {
    font-size: 0.78rem;
    color: #888;
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aidb-fy-list-item-summary {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Empty state */
.aidb-fy-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    background: #fafafa;
    border-radius: 12px;
    border: 1px dashed #ddd;
}

.aidb-fy-empty p {
    margin: 4px 0;
    font-size: 0.9rem;
}

/* Notice (login / no profile) */
.aidb-fy-notice {
    text-align: center;
    padding: 40px 30px;
    background: #f8f9fa;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    margin: 0 0 32px;
}

.aidb-fy-notice h2 {
    font-size: 1.3rem;
    margin: 0 0 12px;
}

.aidb-fy-notice p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.7;
    margin: 0 0 8px;
}

.aidb-fy-notice a {
    color: #333;
    font-weight: 600;
}

.aidb-fy-cta-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 32px;
    background: #1a1a1a;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s;
}

.aidb-fy-cta-btn:hover {
    background: #333;
    text-decoration: none !important;
    color: #fff !important;
}

.aidb-fy-notice-hint {
    font-size: 0.8rem !important;
    color: #999 !important;
    margin-top: 16px !important;
}

.aidb-fy-sample-note {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 24px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

/* Profile actions row */
.aidb-fy-profile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.aidb-fy-profile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.aidb-fy-profile-toggle:hover,
.aidb-fy-profile-toggle.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* Profile Management Panel */
.aidb-fy-mgmt {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.aidb-fy-mgmt-inner {
    padding: 20px 24px;
}

.aidb-fy-mgmt-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.aidb-fy-mgmt-section {
    margin-bottom: 16px;
}

.aidb-fy-mgmt-section h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    margin: 0 0 10px;
}

.aidb-fy-tag-kw {
    background: #eee;
    color: #555;
}

.aidb-fy-mgmt-hint {
    font-size: 0.78rem;
    color: #999;
    margin: 0 0 10px;
}

/* Chat log */
.aidb-fy-chat-log {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px;
    background: #fafafa;
}

/* Turn (Q&A pair) */
.aidb-fy-turn {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    transition: opacity 0.2s;
}

.aidb-fy-turn:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.aidb-fy-turn:first-child {
    padding-top: 0;
}

.aidb-fy-turn-body {
    flex: 1;
    min-width: 0;
}

.aidb-fy-turn-delete {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    color: #ccc;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 2px;
}

.aidb-fy-turn-delete:hover {
    color: #d32f2f;
    border-color: #e0e0e0;
    background: #fff;
}

.aidb-fy-turn-delete:disabled {
    opacity: 0.3;
    cursor: default;
}

.aidb-fy-chat-msg {
    margin-bottom: 6px;
    font-size: 0.82rem;
    line-height: 1.6;
}

.aidb-fy-chat-msg:last-child {
    margin-bottom: 0;
}

.aidb-fy-chat-role {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.aidb-fy-chat-user .aidb-fy-chat-role {
    background: #eee;
    color: #555;
}

.aidb-fy-chat-assistant .aidb-fy-chat-role {
    background: #e8e8e8;
    color: #555;
}

.aidb-fy-chat-text {
    color: #333;
}

/* Danger zone */
.aidb-fy-mgmt-danger {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.aidb-fy-mgmt-danger p {
    font-size: 0.8rem;
    color: #888;
    margin: 0 0 12px;
    line-height: 1.6;
}

.aidb-fy-btn-danger {
    padding: 8px 20px;
    border: 1px solid #e57373;
    border-radius: 6px;
    background: #fff;
    color: #d32f2f;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.aidb-fy-btn-danger:hover {
    background: #ffebee;
}

.aidb-fy-btn-danger:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Card wrapper (for post cards with feedback buttons outside the <a>) */
.aidb-fy-card-wrap {
    position: relative;
}

/* Feedback buttons */
.aidb-fy-feedback {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.aidb-fy-fb-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 0.72rem;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1;
}

.aidb-fy-fb-btn:hover {
    border-color: #bbb;
    color: #555;
}

.aidb-fy-fb-btn svg {
    flex-shrink: 0;
}

/* Like button active state */
.aidb-fy-fb-like.active {
    background: #fff0f3;
    border-color: #e8899a;
    color: #d44060;
}

.aidb-fy-fb-like.active svg {
    fill: #d44060;
}

/* Like button hover */
.aidb-fy-fb-like:hover {
    color: #d44060;
    border-color: #e8899a;
}

/* Dislike button hover */
.aidb-fy-fb-dislike:hover {
    color: #999;
    border-color: #aaa;
}

.aidb-fy-fb-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Post card footer needs feedback alignment */
.aidb-fy-card-wrap .aidb-fy-feedback {
    padding: 6px 16px 12px;
    justify-content: flex-end;
}

/* List item footer needs feedback alignment */
.aidb-fy-list-item .aidb-fy-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* Visitor preview: content fades at the bottom into login gate */
.aidb-fy-preview-content {
    position: relative;
    max-height: 720px;
    overflow: hidden;
}

.aidb-fy-preview-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.85) 50%, #fff 100%);
    pointer-events: none;
}

/* Login gate CTA (below preview content) */
.aidb-fy-gate {
    text-align: center;
    padding: 20px 30px 10px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
}

.aidb-fy-gate-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px;
}

.aidb-fy-gate-sub {
    font-size: 0.82rem;
    color: #999;
    margin-top: 14px;
}

/* Premium upsell teaser (below limited content) */
.aidb-fy-premium-upsell {
    margin-top: 16px;
    border: 1px dashed #ddd;
    border-radius: 10px;
    background: #fafafa;
    padding: 24px 20px;
}

.aidb-fy-premium-upsell-inner {
    text-align: center;
}

.aidb-fy-premium-upsell-text {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 14px;
}

.aidb-fy-cta-btn-sm {
    padding: 9px 24px;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .aidb-fy {
        padding: 10px 0 28px;
    }

    .aidb-fy-profile {
        padding: 20px 16px;
        border-radius: 12px;
        margin-bottom: 20px;
    }

    .aidb-fy-page-title {
        font-size: 1.2rem;
    }

    .aidb-fy-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .aidb-fy-card {
        display: flex;
        flex-direction: row;
    }

    .aidb-fy-card-thumb {
        width: 110px;
        min-width: 110px;
        aspect-ratio: 1 / 1;
    }

    .aidb-fy-card-body {
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
    }

    .aidb-fy-card-title {
        font-size: 0.85rem;
    }

    .aidb-fy-card-excerpt {
        display: none;
    }

    .aidb-fy-list-item {
        padding: 12px 14px;
    }

    .aidb-fy-list-item-title {
        font-size: 0.9rem;
    }

    .aidb-fy-list-item-summary {
        -webkit-line-clamp: 2;
    }

    .aidb-fy-fb-btn span {
        display: none;
    }

    .aidb-fy-fb-btn {
        padding: 6px;
    }
}
