/*
=============================================
Basket Random - Main Stylesheet
Imports the basketballgame.io-inspired layout
=============================================
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
@import url('layout-new.css');

/* ============ Additional Homepage Overrides ============ */

/* Ensure smooth page transitions */
html {
    scroll-behavior: smooth;
}

/* Loading state for game cards */
.game-card {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* ============ Section Containers ============ */
.section-container {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-card, rgba(30, 41, 59, 0.5));
    border-radius: 16px;
    border: 1px solid var(--border, rgba(99, 102, 241, 0.1));
    max-width: 900px;
}

.section-container:first-child {
    margin-top: 0;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--purple, #6366f1);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 20px;
}

/* ============ Games Grid ============ */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

@media (min-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

/* ============ Content Section (About Game) ============ */
.content-section {
    margin-top: 25px;
    padding: 25px;
    background: var(--bg-card, rgba(30, 41, 59, 0.5));
    border-radius: 16px;
    border: 1px solid var(--border, rgba(99, 102, 241, 0.1));
    color: var(--text-secondary, #a0aec0);
    line-height: 1.7;
    max-width: 900px;
}

.content-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 12px;
}

.content-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-top: 20px;
    margin-bottom: 8px;
}

.content-section p {
    margin-bottom: 12px;
}

.content-section ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.content-section li {
    margin-bottom: 6px;
}

/* ============ Sitemap Section ============ */
.sitemap-section {
    margin-top: 25px;
}

.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.sitemap-column h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--purple, #6366f1);
}

.sitemap-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sitemap-column li {
    margin-bottom: 6px;
}

.sitemap-column a {
    color: var(--text-secondary, #a0aec0);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s, padding-left 0.2s;
    display: block;
    padding: 3px 0;
}

.sitemap-column a:hover {
    color: var(--purple, #6366f1);
    padding-left: 6px;
}

/* ============ Right Sidebar ============ */
.right-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.right-sidebar-section {
    background: var(--bg-card, rgba(30, 41, 59, 0.5));
    border-radius: 16px;
    border: 1px solid var(--border, rgba(99, 102, 241, 0.1));
    padding: 20px;
    position: sticky;
    top: 90px;
}

.right-sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.right-sidebar-title i {
    color: var(--purple, #6366f1);
}

.right-game-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.right-game-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    background: rgba(255, 255, 255, 0.03);
}

.right-game-item:hover {
    background: rgba(99, 102, 241, 0.15);
    transform: translateX(4px);
}

.right-game-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.right-game-info {
    flex: 1;
    min-width: 0;
}

.right-game-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.right-game-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.75rem;
}

.right-game-rating {
    color: #f59e0b;
}

.right-game-rating i {
    font-size: 0.7rem;
}

.right-game-category {
    color: var(--text-secondary, #a0aec0);
    text-transform: capitalize;
}

/* ============ Game Layout (2-column) ============ */
.game-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.game-main-column {
    flex: 1;
    min-width: 0;
}

/* ============ Comments ============ */
.comments-container {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-card, rgba(30, 41, 59, 0.5));
    border-radius: 16px;
    border: 1px solid var(--border, rgba(99, 102, 241, 0.1));
    max-width: 900px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 5px;
}

.comment-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-item.reply {
    margin-left: 24px;
    margin-top: 10px;
    border-left: 3px solid var(--purple, #6366f1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
}

.comment-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--purple, #6366f1);
}

.comment-badge.admin {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-secondary, #a0aec0);
}

.comment-text {
    color: var(--text-secondary, #a0aec0);
    line-height: 1.6;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.comment-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary, #a0aec0);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.comment-action-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--purple, #6366f1);
}

.comment-action-btn.active {
    color: var(--purple, #6366f1);
}

.comment-replies {
    margin-top: 10px;
}

/* Comment Form */
.comment-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border, rgba(99, 102, 241, 0.1));
}

.comment-form h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 15px;
}

.form-row {
    margin-bottom: 12px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border, rgba(99, 102, 241, 0.15));
    border-radius: 10px;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--purple, #6366f1);
}

.comment-form textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-btn {
    background: linear-gradient(135deg, var(--purple, #6366f1), var(--purple-light, #818cf8));
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

/* Reply Form */
.reply-form {
    margin-top: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.reply-form textarea {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border, rgba(99, 102, 241, 0.15));
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
    font-family: inherit;
    min-height: 60px;
    resize: vertical;
    box-sizing: border-box;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--purple, #6366f1);
}

.reply-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.cancel-reply-btn,
.submit-reply-btn {
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-reply-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #a0aec0);
}

.submit-reply-btn {
    background: var(--purple, #6366f1);
    color: #fff;
}

/* ============ Category Header ============ */
.category-header-section {
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.category-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary, #fff);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-transform: capitalize;
}

.category-title i {
    color: var(--purple, #6366f1);
}

.category-description {
    color: var(--text-secondary, #a0aec0);
    font-size: 1rem;
    line-height: 1.6;
}

.category-description strong {
    color: var(--text-primary, #fff);
}

/* ============ Search Results Fixes ============ */
.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
    display: none;
}

.search-results.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    text-decoration: none;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.search-result-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.search-result-category {
    font-size: 0.75rem;
    color: var(--text-secondary, #a0aec0);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .right-sidebar {
        display: none;
    }

    .game-layout {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .sitemap-grid {
        grid-template-columns: 1fr;
    }

    .section-container,
    .content-section,
    .comments-container {
        padding: 16px;
    }
}