/**
 * Recipe Sidebar Styles
 *
 * @file: recipe-sidebar.css
 * @description: Стилі для кастомного sidebar на сторінках рецептів
 * @created: 2025-11-30
 * @since: 6.0.0 (UX Optimization)
 */

/* ==========================================================================
   Recipe Page Layout (Two-Column)
   ========================================================================== */

.gotuimo-recipe-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.gotuimo-recipe-layout .site-main {
    flex: 1;
    min-width: 0;
    max-width: 800px;
}

.gotuimo-recipe-layout .gotuimo-recipe-sidebar {
    width: 320px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .gotuimo-recipe-layout {
        flex-direction: column;
    }
    
    .gotuimo-recipe-layout .site-main {
        max-width: 100%;
    }
    
    .gotuimo-recipe-layout .gotuimo-recipe-sidebar {
        width: 100%;
    }
}

/* ==========================================================================
   Base Sidebar Styles
   ========================================================================== */

.gotuimo-recipe-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.gotuimo-widget {
    background: var(--bb-content-background-color, #fff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.gotuimo-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Однаковий ховер для всіх блоків - без підйому і трансформації */
.gotuimo-widget,
.gotuimo-author-card {
    transform: none !important;
}

.gotuimo-author-card:hover {
    border-color: transparent;
    outline: none;
    transform: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.gotuimo-widget .widget-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bb-content-border-color, #eee);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bb-headings-color, #333);
    text-align: center;
    line-height: 1;
}

.gotuimo-widget .widget-title i {
    color: #e74c3c;
    font-size: 1.1em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.gotuimo-widget .view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    padding: 12px 20px;
    background: #e74c3c;
    border-radius: 100px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.gotuimo-widget .view-all-link:hover {
    background: #c0392b;
    color: #fff;
}

.gotuimo-widget .view-all-link i {
    color: #fff;
}

/* ==========================================================================
   Related Recipes Widget
   ========================================================================== */

.gotuimo-related-recipes .related-recipes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gotuimo-related-recipes .related-recipe-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bb-content-border-color, #f0f0f0);
}

.gotuimo-related-recipes .related-recipe-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.gotuimo-related-recipes .related-recipe-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.gotuimo-related-recipes .related-recipe-link:hover {
    opacity: 0.8;
}

.gotuimo-related-recipes .related-recipe-thumb {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
}

.gotuimo-related-recipes .related-recipe-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gotuimo-related-recipes .related-recipe-info {
    flex: 1;
    min-width: 0;
}

.gotuimo-related-recipes .related-recipe-title {
    display: block;
    font-weight: 500;
    color: var(--bb-headings-color, #333);
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gotuimo-related-recipes .related-recipe-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--bb-alternate-text-color, #888);
}

.gotuimo-related-recipes .related-recipe-time i {
    color: #e74c3c;
}

/* ==========================================================================
   Author Card Widget
   ========================================================================== */

.gotuimo-author-card .author-card-content {
    text-align: center;
}

.gotuimo-author-card .author-avatar-wrapper {
    margin-bottom: 12px;
}

.gotuimo-author-card .author-avatar-wrapper img,
.gotuimo-author-card .author-avatar-wrapper .author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bb-primary-color, #e74c3c);
}

.gotuimo-author-card .author-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bb-headings-color, #333);
    text-decoration: none;
    margin-bottom: 8px;
}

.gotuimo-author-card .author-name:hover {
    color: var(--bb-primary-color, #e74c3c);
}

.gotuimo-author-card .author-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.gotuimo-author-card .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--bb-alternate-text-color, #666);
}

.gotuimo-author-card .stat-item i {
    color: #e74c3c;
}

.gotuimo-author-card .author-bio {
    font-size: 0.9rem;
    color: var(--bb-alternate-text-color, #666);
    line-height: 1.5;
    margin-bottom: 16px;
}

.gotuimo-author-card .author-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gotuimo-author-card .btn-author-recipes,
.gotuimo-author-card .btn-author-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gotuimo-author-card .btn-author-recipes {
    background: #e74c3c;
    color: #fff;
    border-radius: 100px;
}

.gotuimo-author-card .btn-author-recipes:hover {
    background: #c0392b;
}

/* Стилізація кнопки BuddyPress Connect */
.gotuimo-author-card .generic-button a,
.gotuimo-author-card .friendship-button a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #e74c3c;
    color: #fff !important;
    border: none;
}

.gotuimo-author-card .generic-button a:hover,
.gotuimo-author-card .friendship-button a:hover {
    background: #c0392b;
}

/* Якщо вже Connected - сірий стиль */
.gotuimo-author-card .is_friend a,
.gotuimo-author-card .awaiting_response a,
.gotuimo-author-card .pending a {
    background: #f5f5f5;
    color: #666 !important;
}

.gotuimo-author-card .is_friend a:hover,
.gotuimo-author-card .awaiting_response a:hover,
.gotuimo-author-card .pending a:hover {
    background: #e0e0e0;
}

.gotuimo-author-card .btn-author-message {
    background: var(--bb-content-alternate-background-color, #f5f5f5);
    color: var(--bb-body-text-color, #333);
}

.gotuimo-author-card .btn-author-message:hover {
    background: var(--bb-content-border-color, #ddd);
}

/* ==========================================================================
   Top Users Widget
   ========================================================================== */

.gotuimo-top-users .top-users-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gotuimo-top-users .top-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bb-content-border-color, #f0f0f0);
}

.gotuimo-top-users .top-user-item:last-child {
    border-bottom: none;
}

.gotuimo-top-users .user-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bb-content-alternate-background-color, #eee);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bb-alternate-text-color, #666);
}

.gotuimo-top-users .top-user-item.gold .user-rank {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #fff;
}

.gotuimo-top-users .top-user-item.silver .user-rank {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #fff;
}

.gotuimo-top-users .top-user-item.bronze .user-rank {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: #fff;
}

.gotuimo-top-users .user-avatar-link img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.gotuimo-top-users .user-info {
    flex: 1;
    min-width: 0;
}

.gotuimo-top-users .user-name {
    display: block;
    font-weight: 500;
    color: var(--bb-headings-color, #333);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gotuimo-top-users .user-name:hover {
    color: var(--bb-primary-color, #e74c3c);
}

.gotuimo-top-users .user-recipes-count {
    font-size: 0.8rem;
    color: var(--bb-alternate-text-color, #888);
}

/* ==========================================================================
   Achievements Widget (GamiPress)
   ========================================================================== */

.gotuimo-achievements .achievements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gotuimo-achievements .achievement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #fff8e1, #fff);
    border-radius: 10px;
    border: 1px solid #ffd54f;
}

.gotuimo-achievements .achievement-badge {
    flex-shrink: 0;
}

.gotuimo-achievements .achievement-badge img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: contain;
}

.gotuimo-achievements .achievement-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #ffd700, #ffb300);
    border-radius: 8px;
}

.gotuimo-achievements .achievement-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bb-headings-color, #333);
}

.gotuimo-achievements .author-points {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 10px;
    background: var(--bb-content-alternate-background-color, #f9f9f9);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bb-alternate-text-color, #666);
}

.gotuimo-achievements .author-points i {
    color: #ffc107;
}

/* ==========================================================================
   Community CTA Widget
   ========================================================================== */

/* Окремі CTA віджети */
.gotuimo-join-group-widget,
.gotuimo-contest-widget,
.gotuimo-add-recipe-widget {
    padding: 20px;
}

.gotuimo-join-group-widget .cta-block,
.gotuimo-contest-widget .cta-block,
.gotuimo-add-recipe-widget .cta-block {
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-left: none;
}

/* CTA кнопки в окремих віджетах */
.gotuimo-join-group-widget .cta-button,
.gotuimo-contest-widget .cta-button,
.gotuimo-add-recipe-widget .cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #e74c3c;
    color: #fff;
    border: none;
}

.gotuimo-join-group-widget .cta-button:hover,
.gotuimo-contest-widget .cta-button:hover,
.gotuimo-add-recipe-widget .cta-button:hover {
    background: #c0392b;
}

/* Стилі тексту в CTA - все по центру */
.gotuimo-join-group-widget .cta-block,
.gotuimo-contest-widget .cta-block,
.gotuimo-add-recipe-widget .cta-block {
    text-align: center;
}

.gotuimo-join-group-widget .cta-title,
.gotuimo-contest-widget .cta-title,
.gotuimo-add-recipe-widget .cta-title {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bb-headings-color, #333);
    text-align: center;
}

.gotuimo-join-group-widget .cta-text,
.gotuimo-contest-widget .cta-text,
.gotuimo-add-recipe-widget .cta-text {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: var(--bb-alternate-text-color, #666);
    line-height: 1.4;
    text-align: center;
}

.gotuimo-join-group-widget .cta-icon,
.gotuimo-contest-widget .cta-icon,
.gotuimo-add-recipe-widget .cta-icon {
    text-align: center;
}

.gotuimo-join-group-widget .cta-icon i,
.gotuimo-contest-widget .cta-icon i,
.gotuimo-add-recipe-widget .cta-icon i {
    font-size: 2rem;
    color: #e74c3c;
    margin-bottom: 12px;
    display: inline-block;
}

/* Старий контейнер (для сумісності) */
.gotuimo-community-cta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.gotuimo-community-cta .cta-block {
    position: relative;
    padding: 20px;
    border-radius: 12px;
    background: var(--bb-content-background-color, #fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gotuimo-community-cta .cta-block:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.gotuimo-community-cta .cta-add-recipe {
    background: linear-gradient(135deg, #fff5f5, #fff);
    border-left: 4px solid #e74c3c;
}

.gotuimo-community-cta .cta-join-group {
    background: linear-gradient(135deg, #fff5f5, #fff);
    border-left: 4px solid #e74c3c;
}

.gotuimo-community-cta .cta-contest {
    background: linear-gradient(135deg, #fff5f5, #fff);
    border-left: 4px solid #e74c3c;
}

.gotuimo-community-cta .cta-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: #f39c12;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.gotuimo-community-cta .cta-icon {
    margin-bottom: 12px;
}

.gotuimo-community-cta .cta-icon i {
    font-size: 2rem;
    color: #e74c3c;
}

.gotuimo-community-cta .cta-title {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bb-headings-color, #333);
}

.gotuimo-community-cta .cta-text {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: var(--bb-alternate-text-color, #666);
    line-height: 1.4;
}

.gotuimo-community-cta .cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #e74c3c;
    color: #fff;
    border: none;
}

.gotuimo-community-cta .cta-button:hover {
    background: #c0392b;
}

/* Всі кнопки однаковий червоний стиль */
.gotuimo-community-cta .cta-button-secondary,
.gotuimo-community-cta .cta-button-accent {
    background: #e74c3c;
}

.gotuimo-community-cta .cta-button-secondary:hover,
.gotuimo-community-cta .cta-button-accent:hover {
    background: #c0392b;
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

body.dark .gotuimo-widget {
    background: var(--bb-dark-content-background-color, #2d2d2d);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark .gotuimo-widget .widget-title {
    border-bottom-color: var(--bb-dark-content-border-color, #444);
    color: var(--bb-dark-headings-color, #eee);
}

body.dark .gotuimo-widget .view-all-link {
    background: var(--bb-dark-content-alternate-background-color, #3a3a3a);
}

body.dark .gotuimo-related-recipes .related-recipe-item {
    border-bottom-color: var(--bb-dark-content-border-color, #444);
}

body.dark .gotuimo-related-recipes .related-recipe-title {
    color: var(--bb-dark-headings-color, #eee);
}

body.dark .gotuimo-author-card .author-name {
    color: var(--bb-dark-headings-color, #eee);
}

body.dark .gotuimo-top-users .top-user-item {
    border-bottom-color: var(--bb-dark-content-border-color, #444);
}

body.dark .gotuimo-top-users .user-name {
    color: var(--bb-dark-headings-color, #eee);
}

body.dark .gotuimo-community-cta .cta-block {
    background: var(--bb-dark-content-background-color, #2d2d2d);
}

body.dark .gotuimo-community-cta .cta-add-recipe {
    background: linear-gradient(135deg, #3a2525, #2d2d2d);
}

body.dark .gotuimo-community-cta .cta-join-group {
    background: linear-gradient(135deg, #1a3a4f, #2d2d2d);
}

body.dark .gotuimo-community-cta .cta-contest {
    background: linear-gradient(135deg, #3a3020, #2d2d2d);
}

body.dark .gotuimo-community-cta .cta-title {
    color: var(--bb-dark-headings-color, #eee);
}

/* ==========================================================================
   Responsive Design (Mobile-first)
   ========================================================================== */

@media (max-width: 768px) {
    .gotuimo-recipe-sidebar {
        margin-top: 40px;
        padding-top: 24px;
        border-top: 1px solid var(--bb-content-border-color, #eee);
    }
    
    .gotuimo-widget {
        padding: 16px;
    }
    
    .gotuimo-author-card .author-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .gotuimo-author-card .btn-author-recipes,
    .gotuimo-author-card .btn-author-message {
        flex: 1;
        min-width: 120px;
    }
    
    .gotuimo-achievements .achievements-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

