/* ===== LAYOUT З SIDEBAR ===== */
.page-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 16px;
    align-items: start;
    margin-top: 10px;
}

.main-col {
    min-width: 0;
    /* запобігає переповненню grid */
}

/* ===== SIDEBAR ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: static;
    top: 50px;
    max-height: calc(100vh - 50px);
    /*overflow-y: auto;*/
    scrollbar-width: none;
    margin-bottom: 10px;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

/* Chrome */

/* ===== WIDGET ===== */
.sidebar-widget {
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid #bdbdbd;
    /*overflow: hidden;*/
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body:not(.dark-mode) .sidebar-widget {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sidebar-widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.15);
    color: var(--accent-color, #fbbf24);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body:not(.dark-mode) .sidebar-widget-title {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
    color: #1e293b;
}

.sidebar-widget-body {
    padding: 12px 14px;
}

/* ===== АКТОР ДНЯ ===== */
.actor-day-photo-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 10px;
}

.actor-day-photo {
    width: 100%;
    height: 100%;
    object-fit: none;
    object-position: top;
    display: block;
}

.actor-day-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--accent-color, #fbbf24);
}

.actor-day-text {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--dark-text-muted, #94a3b8);
}

body:not(.dark-mode) .actor-day-text {
    color: #64748b;
}

/* ===== НОВИНИ ===== */
.news-item {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

body:not(.dark-mode) .news-item {
    border-bottom-color: #e2e8f0;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    opacity: 0.75;
}

.news-item-date {
    font-size: 0.7rem;
    color: var(--dark-text-muted, #94a3b8);
    margin-bottom: 3px;
}

.news-item-title {
    font-size: 0.8rem;
    line-height: 1.4;
    font-weight: 500;
}


/* ===== СТАТИСТИКА =====  */
.stat-item {
    text-align: center;
    padding: 6px 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color, #fbbf24);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--dark-text-muted, #94a3b8);
    margin-top: 4px;
}

body:not(.dark-mode) .stat-label {
    color: #64748b;
}

/* ===== МОБІЛЬНА ВЕРСІЯ ===== */
@media (max-width: 900px) {
    body[data-page="index"] .container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    body[data-page="index"] .page-layout,
    body[data-page="index"] .main-col,
    body[data-page="index"] .sidebar {
        display: contents !important;
    }

    body[data-page="index"] .logo-switch {
        order: 1 !important;
    }

    body[data-page="index"] .nav {
        order: 2 !important;
    }

    body[data-page="index"] .titlename {
        order: 3 !important;
    }

    body[data-page="index"] #news-widget {
        order: 10 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] #actor-of-day {
        order: 20 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] .sort-container {
        order: 30 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] .carousel-wrapper {
        order: 35 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] .user-container {
        order: 40 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] #stats-widget {
        order: 50 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] .footer {
        order: 60 !important;
        grid-column: 1 / -1;
    }
}

/* ===== RIGHT SIDEBAR ARCHITECTURE ===== */
.page-layout-right-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
    margin-bottom: 40px;
}

.main-content-area {
    min-width: 0;
}

.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    color: var(--text-main);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.sidebar-block h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.sidebar-content-placeholder {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

body.dark-mode .sidebar-content-placeholder {
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 991px) {
    .page-layout-right-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar-right {
        position: static;
        margin-top: 20px;
    }
}

/* ===== BORDEAUX DARK THEME (SIDEBAR) ===== */
body.dark-mode .sidebar-block {
    background: #1a0f12;
    /* ??????????? ???????? ?????? */
    border: 1px solid rgba(128, 0, 32, 0.3);
    /* ???? ???????? ???????? ?????? */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .sidebar-block:hover {
    border-color: rgba(128, 0, 32, 0.6);
}

body.dark-mode .sidebar-block h3 {
    border-bottom: 2px solid #800020;
    /* ??????????? ???????? ?????? */
    color: #f3e8eb;
    /* ?'???? ????-??????? ????? ??? ????????? */
}

.btn-bordeaux {
    background: var(--color-bordeaux, #800020);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

.btn-bordeaux:hover {
    background: #5a0016;
    transform: translateY(-1px);
}

.btn-bordeaux:active {
    transform: translateY(0);
}


/* ── Actor of the Day Card ── */
.actor-day-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card-inner);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.actor-day-card:hover {
    border-color: var(--color-bordeaux, #800020);
    box-shadow: 0 4px 12px rgba(128, 0, 32, 0.15);
    background: var(--bg-card-hover);
}

.actor-day-photo {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-bordeaux, #800020);
}

.actor-day-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.actor-day-card:hover .actor-day-photo img {
    transform: scale(1.1);
}

.actor-day-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.actor-day-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.actor-day-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ff4d6d;
    background: rgba(128, 0, 32, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    width: max-content;
}

body.dark-mode .actor-day-badge {
    background: rgba(255, 77, 109, 0.1);
    color: #ff758f;
}
/* Dark mode specific background for the actor card */
body.dark-mode .actor-day-card {
    background: #1E1417;
}
/* ── Tooltip Styles ── */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}


.tooltip-text {
    position: absolute;
    bottom: 125%; /* Show above the icon */
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2a0610 0%, #1a0308 100%);
    border: 1px solid rgba(128, 0, 32, 0.5);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: normal;
    width: 220px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
}

/* Tooltip Arrow */
.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2a0610 transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip-text {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}
/* -- xp-info-icon Styles -- */
.xp-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(128, 0, 32, 0.2); /* Бордовий прозорий фон */
    border: 1px solid rgba(128, 0, 32, 0.5); /* Бордовий бордер */
    color: #b11226; /* Красивий винний колір замість пожежного рожевого */
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    flex-shrink: 0;
    line-height: 1;
}

.xp-info-icon:hover {
    background: rgba(128, 0, 32, 0.35);
    border-color: rgba(128, 0, 32, 0.7);
    transform: scale(1.05);
}

/* ── Trending News Card ── */
.trending-news-card {
    display: block;
    background: var(--bg-card-inner);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

body.dark-mode .trending-news-card {
    background: #1E1417;
}

.trending-news-card:hover {
    border-color: var(--color-bordeaux, #800020);
    box-shadow: 0 4px 12px rgba(128, 0, 32, 0.15);
    background: var(--bg-card-hover);
}

.trending-news-photo {
    width: 100%;
    height: 140px;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--color-bordeaux, #800020);
}

.trending-news-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.trending-news-card:hover .trending-news-photo img {
    transform: scale(1.03);
}

.trending-news-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-bordeaux, #800020);
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 10;
}

.trending-news-info {
    padding: 12px;
}

.trending-news-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
