/* Neo-brutalism Blog Sidebar Styles */

/* Sticky sidebar container */
.sticky-sidebar {
    position: sticky;
    top: 100px;
    padding: 0;
}

/* Boxy background for all sidebar elements */
.sticky-sidebar > * {
    background-color: #fdf8f5;
    border: 3px solid #000000;
    border-radius: 0;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dark .sticky-sidebar > * {
    background-color: #1a1715;
    border: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.15);
}

/* Hover effects for sidebar boxes */
.sticky-sidebar > *:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.7);
}

.dark .sticky-sidebar > *:hover {
    box-shadow: 8px 8px 0 rgba(255, 255, 255, 0.15);
}

/* TOC specific styling */
.sticky-sidebar .toc {
    background-color: #fdf8f5;
    border: 3px solid #000000;
    border-radius: 0;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
    margin-bottom: 2rem;
    overflow: hidden;
}

.dark .sticky-sidebar .toc {
    background-color: #1a1715;
    border: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.15);
}

/* TOC header */
.sticky-sidebar .toc h5 {
    background-color: #ff8052;
    color: #ffffff;
    margin: 0;
    padding: 1rem 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #000000;
    font-size: 0.9rem;
}

.dark .sticky-sidebar .toc h5 {
    background-color: #ff9966;
    border-bottom: 3px solid rgba(255, 255, 255, 0.7);
}

/* TOC content */
.sticky-sidebar .toc-content {
    padding: 1.25rem;
}

/* Quiz and other interactive elements */
.sticky-sidebar .toc .toc-content {
    background-color: transparent;
    border: none;
    box-shadow: none;
    margin: 0;
}

/* Share buttons container */
.sticky-sidebar .share-buttons {
    background-color: #fdf8f5 !important;
    border: 3px solid #000000 !important;
    border-radius: 0 !important;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7) !important;
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.dark .sticky-sidebar .share-buttons {
    background-color: #1a1715 !important;
    border: 3px solid rgba(255, 255, 255, 0.7) !important;
    box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.15) !important;
}

/* Share buttons header */
.sticky-sidebar .share-buttons h5 {
    background-color: #ff8052;
    color: #ffffff;
    margin: 0;
    padding: 1rem 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #000000;
    font-size: 0.9rem;
}

.dark .sticky-sidebar .share-buttons h5 {
    background-color: #ff9966;
    border-bottom: 3px solid rgba(255, 255, 255, 0.7);
}

/* Share buttons content */
.sticky-sidebar .share-buttons .share-content {
    padding: 1.25rem;
    background-color: transparent;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Share buttons list */
.sticky-sidebar .share-buttons ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.sticky-sidebar .share-buttons li {
    margin: 0;
}

.sticky-sidebar .share-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: #ff8052;
    color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.sticky-sidebar .share-buttons a:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
    background-color: #e6724a;
}

.dark .sticky-sidebar .share-buttons a {
    background-color: #ff9966;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 2px 2px 0 rgba(255, 255, 255, 0.15);
}

.dark .sticky-sidebar .share-buttons a:hover {
    box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.15);
    background-color: #ffb380;
}

/* Mobile responsive design */
@media (max-width: 991px) {
    .sticky-sidebar {
        position: static;
        top: auto;
        margin-top: 3rem;
        display: block !important;
        visibility: visible !important;
    }

    .sticky-sidebar > * {
        margin-bottom: 1.5rem;
        display: block !important;
        visibility: visible !important;
    }

    /* Ensure sidebar elements appear below content on mobile */
    .col-lg-3 {
        order: 2;
        display: block !important;
    }

    .col-lg-9 {
        order: 1;
    }

    /* Force quiz and wordfill containers to be visible */
    .sticky-sidebar .quiz-container,
    .sticky-sidebar .wordfill-container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Force game area to be visible */
    .sticky-sidebar #game-area {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .sticky-sidebar {
        display: block !important;
        visibility: visible !important;
        margin-top: 2rem;
    }

    .sticky-sidebar > * {
        margin-bottom: 1.25rem;
        box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.7);
        display: block !important;
        visibility: visible !important;
    }

    .dark .sticky-sidebar > * {
        box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.15);
    }

    .sticky-sidebar > *:hover {
        transform: translate(-1px, -1px);
        box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.7);
    }

    .dark .sticky-sidebar > *:hover {
        box-shadow: 5px 5px 0 rgba(255, 255, 255, 0.15);
    }

    .sticky-sidebar .toc h5,
    .sticky-sidebar .share-buttons h5,
    .sticky-sidebar .quiz-container h5,
    .sticky-sidebar .wordfill-container h5 {
        padding: 0.875rem 1rem;
        font-size: 0.85rem;
    }

    .sticky-sidebar .toc-content,
    .sticky-sidebar .share-buttons .share-content {
        padding: 1rem;
    }

    .sticky-sidebar .share-buttons a {
        width: 40px;
        height: 40px;
    }

    /* Mobile game visibility fixes */
    .sticky-sidebar .quiz-container,
    .sticky-sidebar .wordfill-container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: 250px;
    }

    .sticky-sidebar #game-area {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: 200px;
        padding: 1rem;
    }

    .sticky-sidebar #game-area * {
        display: block !important;
        visibility: visible !important;
    }

    .sticky-sidebar #game-area #options {
        display: flex !important;
        flex-direction: column !important;
    }

    .sticky-sidebar #game-area .btn {
        display: block !important;
        visibility: visible !important;
        margin: 0.25rem 0 !important;
    }
}

@media (max-width: 576px) {
    .sticky-sidebar > * {
        margin-bottom: 1rem;
        box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
    }

    .dark .sticky-sidebar > * {
        box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.15);
    }

    .sticky-sidebar .toc h5,
    .sticky-sidebar .share-buttons h5,
    .sticky-sidebar .quiz-container h5,
    .sticky-sidebar .wordfill-container h5 {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .sticky-sidebar .toc-content,
    .sticky-sidebar .share-buttons .share-content {
        padding: 0.875rem;
    }

    .sticky-sidebar .share-buttons ul {
        gap: 0.5rem;
    }

    .sticky-sidebar .share-buttons a {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    /* Mobile game styling */
    .sticky-sidebar #game-area {
        padding: 0.875rem;
    }

    .sticky-sidebar #game-area h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .sticky-sidebar #game-area p {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .sticky-sidebar #game-area #question-text,
    .sticky-sidebar #game-area #question-word {
        font-size: 0.75rem;
        padding: 0.5rem;
        margin-bottom: 0.75rem;
        line-height: 1.2;
    }

    .sticky-sidebar #game-area .btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        margin: 0.25rem 0;
    }

    .sticky-sidebar #game-area input[type="text"] {
        font-size: 0.75rem;
        padding: 0.4rem;
    }

    .sticky-sidebar #game-area #feedback-message,
    .sticky-sidebar #game-area #feedback-word {
        font-size: 0.7rem;
        padding: 0.4rem;
    }

    .sticky-sidebar #game-area #score,
    .sticky-sidebar #game-area #score-word {
        font-size: 0.7rem;
        padding: 0.4rem;
        margin-bottom: 0.75rem;
    }
}

/* Ensure proper spacing between sidebar elements */
.sticky-sidebar .toc + .toc {
    margin-top: 0;
}

/* Fix for quiz and interactive elements */
.sticky-sidebar .row {
    margin: 0;
}

.sticky-sidebar .row .toc {
    margin-bottom: 0;
}

/* Override any conflicting styles for share buttons */
.sticky-sidebar .share-buttons,
.sticky-sidebar aside.share-buttons {
    background-color: #fdf8f5 !important;
    border: 3px solid #000000 !important;
    border-radius: 0 !important;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7) !important;
    margin-bottom: 2rem !important;
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.dark .sticky-sidebar .share-buttons,
.dark .sticky-sidebar aside.share-buttons {
    background-color: #1a1715 !important;
    border: 3px solid rgba(255, 255, 255, 0.7) !important;
    box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.15) !important;
}

/* Ensure share content doesn't have conflicting backgrounds */
.sticky-sidebar .share-buttons .share-content,
.sticky-sidebar .share-buttons .social-content {
    background-color: transparent !important;
    background-image: none !important;
    background: transparent !important;
    padding: 1.25rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Quiz and Word Fill Game Containers */
.sticky-sidebar .quiz-container,
.sticky-sidebar .wordfill-container {
    background-color: #fdf8f5;
    border: 3px solid #000000;
    border-radius: 0;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
    margin-bottom: 2rem;
    overflow: hidden;
}

.dark .sticky-sidebar .quiz-container,
.dark .sticky-sidebar .wordfill-container {
    background-color: #1a1715;
    border: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.15);
}

/* Quiz and Word Fill Headers */
.sticky-sidebar .quiz-container h5,
.sticky-sidebar .wordfill-container h5 {
    background-color: #ff8052;
    color: #ffffff;
    margin: 0;
    padding: 1rem 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #000000;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dark .sticky-sidebar .quiz-container h5,
.dark .sticky-sidebar .wordfill-container h5 {
    background-color: #ff9966;
    border-bottom: 3px solid rgba(255, 255, 255, 0.7);
}

/* Game Area Styling */
.sticky-sidebar #game-area {
    padding: 1.25rem;
    background-color: transparent;
    border: none;
    box-shadow: none;
    margin: 0;
    overflow: hidden;
}

.sticky-sidebar #game-area h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #ff8052;
    font-weight: 700;
    text-align: center;
}

.dark .sticky-sidebar #game-area h3 {
    color: #ff9966;
}

/* Game Elements */
.sticky-sidebar #game-area p {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.sticky-sidebar #game-area #question-text,
.sticky-sidebar #game-area #question-word {
    font-weight: 600;
    background-color: rgba(255, 128, 82, 0.1);
    padding: 0.75rem;
    border-radius: 0;
    border: 2px solid rgba(255, 128, 82, 0.3);
    margin-bottom: 1rem;
    font-size: 0.8rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.dark .sticky-sidebar #game-area #question-text,
.dark .sticky-sidebar #game-area #question-word {
    background-color: rgba(255, 153, 102, 0.1);
    border: 2px solid rgba(255, 153, 102, 0.3);
}

/* Game Options Container */
.sticky-sidebar #game-area #options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Game Buttons */
.sticky-sidebar #game-area .btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0;
    border: 2px solid #000000;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    text-align: left;
    line-height: 1.2;
}

.dark .sticky-sidebar #game-area .btn {
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.sticky-sidebar #game-area .btn-primary {
    background-color: #ff8052;
    color: #ffffff;
}

.sticky-sidebar #game-area .btn-primary:hover {
    background-color: #e6724a;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.dark .sticky-sidebar #game-area .btn-primary {
    background-color: #ff9966;
}

.dark .sticky-sidebar #game-area .btn-primary:hover {
    background-color: #ffb380;
    box-shadow: 2px 2px 0 rgba(255, 255, 255, 0.15);
}

/* Input Fields */
.sticky-sidebar #game-area input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    background-color: #ffffff;
    color: #000000;
}

.dark .sticky-sidebar #game-area input[type="text"] {
    border: 2px solid rgba(255, 255, 255, 0.7);
    background-color: #2a2a2a;
    color: #ffffff;
}

/* Feedback Messages */
.sticky-sidebar #game-area #feedback-message,
.sticky-sidebar #game-area #feedback-word {
    font-size: 0.75rem;
    padding: 0.5rem;
    border-radius: 0;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Score Display */
.sticky-sidebar #game-area #score,
.sticky-sidebar #game-area #score-word {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    background-color: rgba(255, 128, 82, 0.1);
    padding: 0.5rem;
    border-radius: 0;
    border: 2px solid rgba(255, 128, 82, 0.3);
    margin-bottom: 1rem;
}

.dark .sticky-sidebar #game-area #score,
.dark .sticky-sidebar #game-area #score-word {
    background-color: rgba(255, 153, 102, 0.1);
    border: 2px solid rgba(255, 153, 102, 0.3);
}
