/* ============================================================
   BASE + FIXES
   ============================================================ */

/* Custom font and basic setup */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e5e7eb;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Remove gutter restrictions and force full width */
#mainContent {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* All sections inside main content get centered but wide */
#mainContent > div {
    width: 100% !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Ad container full width fix */
#adPlaceholderContainer {
    max-width: 100% !important;
    width: 100% !important;
    min-height: 250px;
}



/* ============================================================
   LOCK OVERLAY
   ============================================================ */

#lockOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.98);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* ============================================================
   ERROR + NOTIFICATION
   ============================================================ */

#messageBox {
    transition: all 0.3s ease-in-out;
    background: #331a1a;
    color: #f87171;
    border-left: 4px solid #ef4444;
}

#notificationBox {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px 20px;
    background-color: #1e293b;
    color: #f87171;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* ============================================================
   STACK DISPLAY
   ============================================================ */

.stack-display {
    display: flex;
    flex-direction: row;            /* horizontal layout */
    align-items: center;
    justify-content: flex-start;
    gap: 10px;                      /* spacing between items */
    width: 100%;
    max-width: 100%;
    overflow-x: auto;               /* scroll if many items */
    padding: 10px 4px;
    box-sizing: border-box;
}

.stack-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    color: #fff;
    border-radius: 8px;
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    font-weight: 700;
    white-space: nowrap;           /* keep each token on one line */
    word-break: keep-all;
    max-width: max-content;        /* auto expand based on text */
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
    flex-shrink: 0;                /* prevents shrinking → no overlap */
}

@keyframes fadeInHorizontal {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.stack-item.safe-animate {
    animation: fadeInHorizontal 0.25s ease-out both;
}
/* ============================================================
   TABLE LOG STYLES
   ============================================================ */

.table-cell-log {
    padding: 12px;
    border-bottom: 1px solid #334155;
    color: #e5e7eb;
}

.table-row-log:nth-child(even) {
    background-color: #1e293b;
}

.table-cell-log.font-semibold {
    color: #93c5fd;
}

.table-cell-log.font-mono {
    color: #fde68a;
}

.table-cell-log.text-gray-600 {
    color: #94a3b8;
}

.table-cell-log .text-green-700 {
    color: #4ade80;
}

.table-cell-log .text-purple-700 {
    color: #c084fc;
}

.table-cell-log.font-medium.text-gray-500.bg-gray-50 {
    background-color: #1e293b;
    color: #94a3b8;
}

.input-group-hidden {
    display: none;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
    background: linear-gradient(180deg, #0f172a 0%, #18181b 100%);
    color: #e2e8f0;
    margin-top: 60px;
    border-top: 3px solid #3b82f6;
    width: 100%;
}

.footer-section h3 {
    font-weight: 700;
    font-size: 1.1rem;
    color: #60a5fa;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.footer-section h3::before {
    content: '';
    width: 3px;
    height: 24px;
    background: linear-gradient(180deg, #3b82f6, #60a5fa);
    margin-right: 12px;
    border-radius: 2px;
}

.footer-link {
    display: block;
    padding: 8px 0;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.footer-link:hover {
    color: #60a5fa;
    transform: translateX(4px);
    padding-left: 4px;
}

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.social-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #23272f;
    border: 1px solid #334155;
    border-radius: 50%;
    color: #60a5fa;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.social-icon:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.4);
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.3), transparent);
    margin: 24px 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #334155;
    font-size: 0.9rem;
    color: #64748b;
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: #1e293b;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #334155;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: #60a5fa;
    font-size: 1.75rem;
    font-weight: 700;
}

@keyframes glow-rotate {
    0% { box-shadow: 0 0 5px #ef4444, 0 0 10px #ef4444; transform: rotate(0deg); }
    100% { box-shadow: 0 0 5px #ef4444, 0 0 10px #ef4444, 0 0 15px #ef4444; transform: rotate(360deg); }
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-btn-svg-container {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
    transition: box-shadow 0.3s, transform 0.3s;
}

.close-btn:hover .close-btn-svg-container {
    animation: glow-rotate 1.5s infinite alternate;
}

.close-btn-svg {
    height: 24px;
    width: 24px;
    stroke-width: 2.5;
    color: #ef4444;
    padding: 4px;
}

.modal-body p, .modal-body ul {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #d1d5db;
}

.modal-body h3 {
    font-weight: 600;
    color: #93c5fd;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

/* ============================================================
   SCROLL TO TOP BUTTON
   ============================================================ */

#scrollToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    line-height: 50px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 90;
}

#scrollToTopBtn.show {
    opacity: 1;
}

#scrollToTopBtn:hover {
    background-color: #2563eb;
    transform: scale(1.1);
}

/* ============================================================
   COMMENTS SECTION
   ============================================================ */

.comments-section {
    background: #1e293b;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 32px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
}

.comments-section h2 {
    color: #60a5fa;
    font-size: 1.5rem;
    margin-bottom: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.comments-section h2::before {
    content: '💬';
    margin-right: 12px;
}

.comment-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    padding: 20px;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid #334155;
}

/* Individual comments */
.comment-item {
    background: #0f172a;
    border-left: 3px solid #3b82f6;
    padding: 16px;
    border-radius: 6px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-name {
    font-weight: 700;
    color: #60a5fa;
    font-size: 1rem;
}

.comment-text {
    color: #e5e7eb;
    line-height: 1.6;
    margin-top: 8px;
    margin-bottom: 12px;
    word-break: break-word;
}

.comment-time {
    font-size: 0.75rem;
    color: #64748b;
}

/* Action bar */
.action-vote-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #1e293b;
}

.like-dislike-container {
    display: flex;
    gap: 12px;
    align-items: center;
    order: 2;
    margin-left: 10px;
}

.comment-actions {
    display: flex;
    gap: 10px;
    order: 3;
    font-size: 0.8rem;
}

.reply-btn {
    order: 1;
    font-weight: 700;
    font-size: 0.85rem;
}

.action-btn {
    font-size: 0.8rem;
    padding: 2px 5px;
}

/* Reply input */
.reply-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.reply-input-row {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: flex-start;
}

.reply-input-row input,
.reply-input-row textarea {
    flex: 1;
    min-height: 36px;
    background: #182335;
    color: #e5e7eb;
}

.reply-input-row textarea {
    flex: 1.5;
    min-height: 60px;
}

.reply-submit-btn {
    align-self: flex-start;
}

/* Nested replies */
.replies-container .comment-header {
    margin-bottom: 0;
}

.replies-container .reply-item .reply-name {
    font-weight: 700;
    color: #93c5fd;
}

.replies-container .reply-item .comment-time {
    margin-left: auto;
}

.replies-container .reply-item .reply-text {
    margin-top: 5px;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.no-comments {
    text-align: center;
    padding: 40px;
    color: #64748b;
}
