/* Mobile-first responsive styles for Vortex */

:root {
    color-scheme: light;
    --primary-color: #1976d2;
    --secondary-color: #424242;
    --danger-color: #d32f2f;
    --success-color: #388e3c;
    --warning-color: #f57c00;
    --background: #f5f5f5;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --shadow-elevation: rgba(0, 0, 0, 0.08);
    --shadow-elevation-strong: rgba(0, 0, 0, 0.16);
    --overlay-color: rgba(0, 0, 0, 0.55);
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #b0b0b0;
    --scrollbar-thumb-hover: #9e9e9e;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --primary-color: #90caf9;
    --secondary-color: #334155;
    --danger-color: #ef9a9a;
    --success-color: #81c784;
    --warning-color: #ffb74d;
    --background: #0f1115;
    --surface: #1b2027;
    --surface-elevated: #232a2f;
    --text-primary: #e3e6eb;
    --text-secondary: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.16);
    --shadow-elevation: rgba(0, 0, 0, 0.45);
    --shadow-elevation-strong: rgba(0, 0, 0, 0.6);
    --overlay-color: rgba(0, 0, 0, 0.7);
    --scrollbar-track: #1f242c;
    --scrollbar-thumb: #3d4654;
    --scrollbar-thumb-hover: #4f5969;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background-color: var(--surface-elevated);
    box-shadow: 0 2px 4px var(--shadow-elevation);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo-text {
    letter-spacing: 2px;
}

.nav {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 70%;
    max-width: 320px;
    height: calc(100vh - 70px);
    background-color: var(--surface-elevated);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 0;
    box-shadow: -2px 0 8px var(--shadow-elevation);
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 1000;
}

.nav.active {
    right: 0;
}

.nav-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

.nav-group-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* Button inside nav-group-actions */
.nav-group-actions .btn {
    margin: 0.5rem 1rem;
    width: calc(100% - 2rem);
    text-align: center;
    display: block;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 0;
    width: 100%;
    text-align: center;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: var(--surface);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* Platform buttons - for Centinel, Forum, Surlink */
.platform-btn {
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-radius: 0;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    color: var(--text-primary) !important;
    border: none;
    width: 100%;
    text-align: center;
    display: block;
}

.platform-btn:hover {
    background: var(--surface);
}

.platform-btn.active {
    background: var(--surface);
    border-left: 3px solid var(--primary-color);
}

/* Buttons inside nav */
.nav .btn {
    margin: 0.5rem 1rem;
    width: calc(100% - 2rem);
    text-align: center;
}

/* Theme toggle inside nav */
.nav-theme-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

/* Menu overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.theme-toggle-container {
    position: relative;
}

.theme-toggle {
    position: relative;
    width: 64px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.theme-toggle:hover .theme-toggle__track {
    border-color: var(--primary-color);
}

.theme-toggle:focus-visible {
    outline: none;
}

.theme-toggle__track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--surface);
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.theme-toggle__slider {
    position: absolute;
    left: 2px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background-color: var(--text-primary);
    display: grid;
    place-items: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.theme-toggle[data-theme-state="dark"] .theme-toggle__slider {
    transform: translateX(32px);
}

.theme-toggle__outline {
    position: absolute;
    inset: -6px;
    border-radius: 16px;
    border: 2px solid transparent;
    opacity: 0;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.theme-toggle:focus-visible .theme-toggle__outline {
    border-color: var(--primary-color);
    opacity: 1;
}

.theme-toggle__icon {
    width: 16px;
    height: 16px;
    fill: var(--surface);
    transition: opacity 0.2s ease;
    position: absolute;
}

.theme-toggle__icon--moon {
    opacity: 0;
}

.theme-toggle[data-theme-state="dark"] .theme-toggle__icon--moon {
    opacity: 1;
}

.theme-toggle[data-theme-state="dark"] .theme-toggle__icon--sun {
    opacity: 0;
}

/* New feature buttons styling */
.nav-link-new {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
}

.nav-link-new:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.7);
    }
}

/* Mobile/Desktop visibility helpers */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-primary:hover {
    background: var(--surface);
    border-color: var(--text-secondary);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--text-secondary);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c62828;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Map Container */
.map-container {
    position: relative;
}

#map {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-elevation);
}

.map-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--surface-elevated);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-elevation);
    z-index: 10;
    max-width: 250px;
}

.map-controls h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.map-controls select,
.map-controls input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.layer-controls {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layer-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.layer-controls input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-color);
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

/* Modal minimized state for location selection */
.modal.minimized {
    background-color: rgba(0, 0, 0, 0); /* Overlay completamente transparente */
    pointer-events: none;
}

.modal.minimized .modal-content {
    opacity: 0.15;
    transform: scale(0.5) translateY(100%);
    pointer-events: none;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .modal.minimized .modal-content {
        opacity: 0.1;
        transform: scale(0.4) translateY(150%);
    }

    /* Improve modal scrolling on mobile */
    .modal {
        align-items: flex-start;
    }

    .modal.active {
        padding: 10px 0;
    }
}

.modal-content {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 20px 40px var(--shadow-elevation-strong);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    margin: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* News Container */
.news-container {
    max-width: 900px;
    margin: 0 auto;
}

.news-container h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.news-item {
    background: var(--surface);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-elevation);
    border: 1px solid var(--border-color);
}

.news-item h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.news-item .news-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.news-item p {
    margin-bottom: 0.5rem;
}

.news-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.news-item a:hover {
    text-decoration: underline;
}

.news-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.5rem 0;
    display: block;
}

#newsMap {
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-elevation);
    margin-top: 2rem;
}

/* Forum Container */
.forum-container {
    max-width: 900px;
    margin: 0 auto;
}

.forum-container h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

#reddit-embed {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-elevation);
    margin: 2rem 0;
}

#reddit-embed iframe {
    width: 100%;
    height: 700px;
    border: none;
}

/* Links Container */
.links-container {
    max-width: 900px;
    margin: 0 auto;
}

.links-container h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.link-item {
    background: var(--surface);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-elevation);
    border: 1px solid var(--border-color);
}

.link-item h3 {
    margin-bottom: 0.5rem;
}

.link-item p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.link-item a:not(.btn) {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    /*margin-top: 2rem;*/
}

.footer a {
    color: white;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .header .container {
        flex-wrap: nowrap;
    }

    .header-controls {
        gap: 0.5rem;
    }

    .theme-toggle {
        width: 56px;
        height: 28px;
    }

    .theme-toggle__slider {
        width: 24px;
        height: 24px;
    }

    .theme-toggle[data-theme-state="dark"] .theme-toggle__slider {
        transform: translateX(28px);
    }

    .nav {
        width: 80%;
        max-width: 280px;
    }

    .nav.active .btn,
    .nav.active .nav-link,
    .nav.active .platform-btn {
        text-align: center;
    }

    #map {
        height: 400px;
    }

    .map-controls {
        position: relative;
        top: auto;
        left: auto;
        margin-top: 1rem;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .nav {
        width: 85%;
        max-width: none;
    }

    #map {
        height: 300px;
    }

    .modal-content {
        padding: 1rem;
        width: 95%;
        max-height: calc(100vh - 20px);
    }

    .modal.active {
        padding: 10px 0;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Content Pages (Privacy, Terms) */
.content-page {
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-elevation);
    border: 1px solid var(--border-color);
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-page h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.content-page h2 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.content-page p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-page ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-page li {
    margin-bottom: 0.5rem;
}

.content-page a {
    color: var(--primary-color);
    text-decoration: none;
}

.content-page a:hover {
    text-decoration: underline;
}

.content-page hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.content-page em {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .content-page {
        padding: 1.5rem;
    }

    .content-page h1 {
        font-size: 1.5rem;
    }

    .content-page h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .content-page {
        padding: 1rem;
    }

    .content-page h1 {
        font-size: 1.25rem;
    }

    .content-page h2 {
        font-size: 1.1rem;
    }
}

/* Welcome Modal Dark Mode Fixes */
html[data-theme="dark"] #welcomeModal h3 {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] #welcomeModal p {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] #welcomeModal strong {
    color: var(--text-primary) !important;
}

html[data-theme="dark"] #welcomeModal .modal-content > div[style*="background: #f5f5f5"] {
    background: #f5f5f5 !important;
    border-color: #667eea !important;
}

html[data-theme="dark"] #welcomeModal .modal-content > div[style*="background: #f5f5f5"] p {
    color: #333 !important;
}

/* Welcome Modal Fixes - "Consejo" text must be black in both light and dark mode */
/* This rule must come AFTER the general strong rule to override it */
#welcomeModal strong.consejo-text,
html[data-theme="dark"] #welcomeModal strong.consejo-text {
    color: #000 !important;
}

/* Forum Styles */
.forum-vortex-container,
.forum-thread-container {
    padding: 2rem 0;
}

/* Sort Buttons */
.sort-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sort-btn:hover {
    background: var(--surface-elevated);
}

.sort-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Hashtag Buttons */
.hashtag-btn {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    font-weight: 500;
}

.hashtag-btn:hover {
    background: var(--surface-elevated);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.hashtag-btn.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Hashtag Filter Buttons */
.hashtag-filter-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.hashtag-filter-btn:hover {
    background: var(--surface-elevated);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.hashtag-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Hashtag Tags in Thread Cards */
.hashtag-tag {
    padding: 0.25rem 0.625rem;
    background: rgba(var(--primary-color-rgb, 102, 126, 234), 0.15);
    color: var(--primary-color);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.hashtag-tag:hover {
    background: rgba(var(--primary-color-rgb, 102, 126, 234), 0.25);
    transform: translateY(-1px);
}

/* Thread Cards */
.thread-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.2s;
}

.thread-card:hover {
    box-shadow: 0 4px 12px var(--shadow-elevation);
    border-color: var(--primary-color);
}

.thread-card-content {
    flex: 1;
}

.thread-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.thread-title a:hover {
    color: var(--primary-color) !important;
}

.thread-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.thread-images-preview {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.thread-preview-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.thread-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.thread-stats {
    display: flex;
    gap: 0.75rem;
    margin-left: auto;
}

/* Like Button */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.like-btn:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.like-btn.liked {
    color: #f44336;
    border-color: #f44336;
}

.like-btn.small {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.like-btn svg {
    transition: transform 0.2s;
}

.like-btn:active svg {
    transform: scale(1.2);
}

/* Reply Button */
.reply-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.reply-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Pagination */
.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: var(--surface-elevated);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Comments */
.comment {
    position: relative;
}

.comment::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

/* Thread Detail */
.thread-detail {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
}

.thread-content {
    font-size: 1.05rem;
}

.thread-images {
    margin: 1.5rem 0;
}

.thread-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow-elevation);
    transition: all 0.2s;
}

/* Quill Editor Dark Mode Support */
html[data-theme="dark"] .ql-toolbar.ql-snow {
    border-color: var(--border-color);
    background: var(--surface-elevated);
}

html[data-theme="dark"] .ql-container.ql-snow {
    border-color: var(--border-color);
}

html[data-theme="dark"] .ql-editor {
    color: var(--text-primary);
}

html[data-theme="dark"] .ql-editor.ql-blank::before {
    color: var(--text-secondary);
}

html[data-theme="dark"] .ql-stroke {
    stroke: var(--text-primary);
}

html[data-theme="dark"] .ql-fill {
    fill: var(--text-primary);
}

html[data-theme="dark"] .ql-picker-label {
    color: var(--text-primary);
}

html[data-theme="dark"] .ql-picker-options {
    background: var(--surface-elevated);
    border-color: var(--border-color);
}

html[data-theme="dark"] .ql-toolbar button:hover,
html[data-theme="dark"] .ql-toolbar button:focus,
html[data-theme="dark"] .ql-toolbar button.ql-active {
    color: var(--primary-color);
}

html[data-theme="dark"] .ql-toolbar button:hover .ql-stroke,
html[data-theme="dark"] .ql-toolbar button:focus .ql-stroke,
html[data-theme="dark"] .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--primary-color);
}

html[data-theme="dark"] .ql-toolbar button:hover .ql-fill,
html[data-theme="dark"] .ql-toolbar button:focus .ql-fill,
html[data-theme="dark"] .ql-toolbar button.ql-active .ql-fill {
    fill: var(--primary-color);
}

/* Quill editor content styling */
.thread-content a,
.comment-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.thread-content code,
.comment-content code {
    background: var(--surface-elevated);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.thread-content pre,
.comment-content pre {
    background: var(--surface-elevated);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.thread-content blockquote,
.comment-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .thread-card {
        flex-direction: column;
    }

    .thread-stats {
        margin-left: 0;
    }

    .forum-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .forum-controls {
        width: 100%;
        justify-content: space-between;
    }

    .comment {
        margin-left: 1rem !important;
    }

    .thread-images {
        grid-template-columns: 1fr !important;
    }

    .ql-toolbar.ql-snow {
        padding: 4px;
    }

    .ql-toolbar.ql-snow .ql-formats {
        margin-right: 8px;
    }

    .user-avatar {
        width: 20px !important;
        height: 20px !important;
    }
}

/* User Avatar Styles */
.user-avatar {
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
    pointer-events: none;
}

.toast-notification {
    min-width: 240px;
    max-width: 360px;
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    background: var(--surface-elevated, #1f2937);
    color: var(--text-primary, #f9fafb);
    box-shadow: 0 20px 25px -15px rgba(15, 23, 42, 0.35);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.toast-notification.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification.toast-success {
    border-left-color: #22c55e;
}

.toast-notification.toast-error {
    border-left-color: #ef4444;
}

.toast-notification.toast-warning {
    border-left-color: #f59e0b;
}

.toast-notification.toast-info {
    border-left-color: #3b82f6;
}

@media (max-width: 640px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
    }

    .toast-notification {
        max-width: 100%;
        min-width: 0;
    }
}
