/**
 * GiftCodeNgon - Sidebar Widgets
 * 
 * @version 1.1.0
 */

/* Base Widget */
.sidebar-widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.sidebar-widget .widget-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: white;
    margin: 0 0 var(--space-3) 0;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
}

.sidebar-widget .widget-title i {
    color: var(--color-primary);
}

/* ================================
   Search Widget
   ================================ */
.sidebar-search {
    padding: var(--space-3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.search-input-wrap:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-icon {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    padding-left: var(--space-3);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: var(--space-3);
    color: white;
    font-size: var(--text-sm);
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-submit {
    background: var(--color-primary);
    border: none;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.search-submit:hover {
    background: var(--color-primary-hover);
}

/* ================================
   Quick Navigation Widget (Sticky on Desktop)
   ================================ */
.sidebar-quick-nav {
    position: relative;
}

/* Make Quick Nav sticky on desktop */
@media (min-width: 1024px) {
    .sidebar-quick-nav {
        position: sticky;
        top: 100px;
        /* Account for fixed header */
        z-index: 100;
    }
}

.quick-nav-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.quick-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.quick-nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: white;
}

.quick-nav-link i {
    width: 20px;
    text-align: center;
    color: var(--color-primary);
}

.quick-nav-link span {
    flex: 1;
}

.quick-nav-top {
    margin-top: var(--space-2);
    border-top: 1px dashed var(--color-border);
    padding-top: var(--space-3);
}

/* ================================
   Top Games Widget
   ================================ */
.sidebar-top-games .widget-title i {
    color: #fbbf24;
}

.top-games-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.top-game-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.top-game-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: white;
    transform: translateX(4px);
}

.top-game-rank {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: var(--font-bold);
    color: var(--color-primary);
}

.top-game-item:nth-child(1) .top-game-rank {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
}

.top-game-item:nth-child(2) .top-game-rank {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
}

.top-game-item:nth-child(3) .top-game-rank {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: white;
}

.top-game-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    flex-shrink: 0;
}

.top-game-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-game-icon i {
    font-size: 12px;
    color: var(--color-primary);
}

.top-game-title {
    flex: 1;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-game-uses {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.top-game-uses i {
    color: var(--color-success);
}

/* ================================
   Related Posts Widget
   ================================ */
.sidebar-related .widget-title i {
    color: var(--color-secondary);
}

.related-posts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.related-post-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.related-post-item:hover {
    background: rgba(139, 92, 246, 0.1);
    color: white;
    transform: translateX(4px);
}

.related-post-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.1);
    flex-shrink: 0;
}

.related-post-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-icon i {
    font-size: 14px;
    color: var(--color-secondary);
}

.related-post-title {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-post-uses {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.related-post-uses i {
    color: var(--color-success);
}

/* ================================
   Recent Posts Widget
   ================================ */
.sidebar-recent .widget-title i {
    color: #22d3ee;
}

.recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.recent-post-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.recent-post-item:hover {
    background: rgba(34, 211, 238, 0.1);
    color: white;
    transform: translateX(4px);
}

.recent-post-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 211, 238, 0.1);
    flex-shrink: 0;
}

.recent-post-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-icon i {
    font-size: 14px;
    color: #22d3ee;
}

.recent-post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.recent-post-title {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-post-date {
    font-size: 10px;
    color: var(--color-text-muted);
}

/* ================================
   Author Box Widget
   ================================ */
.sidebar-author {
    /* Inherits background/border from .sidebar-widget */
    text-align: center;
}

.author-box-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.author-box-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.author-avatar {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.author-info {
    text-align: center;
}

.author-name {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: white;
    margin: 0 0 2px 0;
}

.author-role {
    font-size: var(--text-xs);
    color: var(--color-primary);
    font-weight: var(--font-medium);
}

.author-about {
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.author-about p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    text-align: center;
}

.author-socials {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.social-link:hover {
    transform: translateY(-2px);
    color: white;
}

.social-facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.social-threads:hover {
    background: #000;
    border-color: #000;
}

.social-x:hover {
    background: #000;
    border-color: #000;
}

.social-linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

.social-github:hover {
    background: #333;
    border-color: #333;
}

.social-youtube:hover {
    background: #ff0000;
    border-color: #ff0000;
}

.author-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius-lg);
    color: white;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.author-view-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    color: white;
}