/**
 * Kabar Papua - UI Components
 */

/* ============================================= 
   Buttons
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-secondary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-secondary-dark);
}

.btn-danger {
    background: var(--color-error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-border);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-bg);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ============================================= 
   Form Elements
   ============================================= */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--color-text-light);
}

.form-input.error {
    border-color: var(--color-error);
}

.form-helper {
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.form-error {
    color: var(--color-error);
}

/* ============================================= 
   Cards
   ============================================= */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.card-body {
    padding: var(--space-md);
}

.card-shadow {
    box-shadow: var(--shadow-sm);
}

/* Feed Card */
.feed-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.feed-card:hover {
    box-shadow: var(--shadow-md);
}

.feed-card:active {
    transform: scale(0.98);
}

.feed-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feed-card-image {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
    background-color: var(--color-bg);
}

@media (min-width: 768px) {
    .feed-card-image {
        width: 128px;
        height: 112px;
    }
}

/* ============================================= 
   Badges & Tags
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-secondary);
}

.badge-region {
    background: rgba(220, 38, 38, 0.1);
    color: var(--color-primary);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    background: var(--color-bg);
    color: var(--color-text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.tag:hover {
    background: var(--color-border);
}

/* ============================================= 
   Modal
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ============================================= 
   Drawer
   ============================================= */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    background: var(--color-surface);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    transform: translateX(-100%);
    transition: transform var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer-overlay.active .drawer {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.drawer-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

/* ============================================= 
   Loading States
   ============================================= */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--color-bg) 25%,
            var(--color-border) 50%,
            var(--color-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================= 
   Utility Classes
   ============================================= */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: var(--space-xs);
}

.gap-2 {
    gap: var(--space-sm);
}

.gap-3 {
    gap: var(--space-md);
}

.gap-4 {
    gap: var(--space-lg);
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================= 
   Reddit-style Report Cards
   ============================================= */
.report-card {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    margin-bottom: var(--space-sm);
}

.report-card:hover {
    border-color: #898989;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Vote sidebar - Reddit orange/blue style */
.vote-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: #f8f9fa;
    min-width: 44px;
    gap: 2px;
}

.vote-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #878a8c;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.vote-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.vote-btn.upvote:hover,
.vote-btn.upvote.active {
    color: var(--color-primary);
    background: rgba(220, 38, 38, 0.1);
}

.vote-btn.downvote:hover,
.vote-btn.downvote.active {
    color: var(--color-secondary);
    background: rgba(37, 99, 235, 0.1);
}

.vote-score {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a1a1b;
    padding: 4px 0;
    min-width: 24px;
    text-align: center;
}

.vote-score.positive {
    color: var(--color-primary);
}

.vote-score.negative {
    color: var(--color-secondary);
}

/* Report content */
.report-content {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.report-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.75rem;
    color: #787c7e;
}

.report-author {
    font-weight: 500;
    color: #1c1c1c;
}

.report-author:hover {
    text-decoration: underline;
    cursor: pointer;
}

.report-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1b;
    line-height: 1.35;
    cursor: pointer;
    margin: 0;
}

.report-title:hover {
    color: #0079d3;
}

.report-body {
    font-size: 0.9rem;
    color: #4a4a4a;
    line-height: 1.5;
}

.report-image {
    max-width: 100%;
    max-height: 512px;
    border-radius: 8px;
    margin-top: 8px;
    object-fit: contain;
    background: #f6f7f8;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.report-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #878a8c;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: capitalize;
}

.report-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1b;
}

.report-action-btn i {
    font-size: 1rem;
}

/* Comments section - Reddit style */
.comments-section {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    border: 1px solid var(--color-border);
}

.comment-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.comment-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #edeff1;
    border-radius: 22px;
    font-size: 0.875rem;
    background: #f6f7f8;
    transition: all 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: #0079d3;
    background: white;
    box-shadow: 0 0 0 2px rgba(0, 121, 211, 0.2);
}

.comment-item {
    padding: 8px 0;
    border-bottom: none;
}

.comment-item:last-child {
    padding-bottom: 0;
}

.comment-item .bg-gray-50 {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.15s ease;
}

.comment-item .bg-gray-50:hover {
    border-color: #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1c1c1c;
}

.comment-author:hover {
    text-decoration: underline;
    cursor: pointer;
}

.comment-time {
    font-size: 0.7rem;
    color: #787c7e;
}

.comment-body {
    font-size: 0.9rem;
    color: #1a1a1b;
    line-height: 1.5;
}

/* Threaded comment replies */
.comment-replies,
.replies {
    margin-top: 8px;
}

/* Nested comment indentation with colored border */
.comment-item.ml-6 {
    margin-left: 1.5rem !important;
    padding-left: 1rem !important;
    border-left: 2px solid #e0e0e0;
}

.comment-item.ml-6:hover {
    border-left-color: #0079d3;
}

/* Comment action buttons */
.comment-item button {
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.comment-item button:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* FAB Button - Reddit orange */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ff4500 0%, #ff5722 100%);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    z-index: var(--z-fixed);
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

/* Empty state for reports */
.reports-empty {
    text-align: center;
    padding: 48px 24px;
    color: #787c7e;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.reports-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--color-primary);
    opacity: 0.4;
}

.reports-empty h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.reports-empty p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Sort tabs - Reddit pill style */
.sort-tabs {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 12px;
}

.sort-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #878a8c;
    background: transparent;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sort-tab:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sort-tab.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--color-secondary);
}

.sort-tab i {
    font-size: 1rem;
}

/* Textarea for create report */
.form-textarea {
    width: 100%;
    min-height: 140px;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 1px solid #edeff1;
    border-radius: 8px;
    background: var(--color-surface);
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
    transition: all 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Privacy Selector */
.privacy-selector {
    display: flex;
    gap: 6px;
    border-radius: 12px;
    background: #f3f4f6;
    padding: 4px;
}

.privacy-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    user-select: none;
}

.privacy-option:hover {
    background: #e5e7eb;
    color: #374151;
}

.privacy-option.active {
    background: white;
    color: #7c3aed;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.privacy-option i {
    font-size: 16px;
}

.privacy-option span {
    font-size: 10px;
    line-height: 1.2;
}

/* People Picker */
.people-picker {
    margin-top: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.people-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.people-search-box input {
    border: none;
    outline: none;
    background: none;
    flex: 1;
    font-size: 13px;
}

.selected-people {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
}

.selected-people:empty {
    display: none;
}

.people-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ede9fe;
    color: #7c3aed;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.people-tag i {
    cursor: pointer;
    font-size: 10px;
    opacity: 0.6;
}

.people-tag i:hover {
    opacity: 1;
}

.people-results {
    max-height: 180px;
    overflow-y: auto;
}

.people-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.people-result-item:hover {
    background: #f3f4f6;
}

.people-result-item.selected {
    background: #f0fdf4;
}

/* Feed card styling */
.feed-card {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.feed-card:hover {
    border-color: #898989;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}

.feed-card-content {
    flex: 1;
    padding: 12px 16px;
    min-width: 0;
}

.feed-card-image {
    width: 140px;
    min-height: 100px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .feed-card-image {
        width: 100px;
        min-height: 80px;
    }
}

/* Badge styling */
.badge-region {
    background: linear-gradient(135deg, #ff4500, #ff6b35);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Tag styling */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f6f7f8;
    color: #0079d3;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.tag:hover {
    background: #e8f4fd;
    border-color: #0079d3;
    text-decoration: none;
}

/* Text utilities */
.text-error {
    color: #ff4500 !important;
}

.text-muted {
    color: #787c7e !important;
}

/* ============================================= 
   Reddit-style Unified Feed Cards
   ============================================= */
.reddit-card {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.reddit-card:hover {
    border-color: #898989;
}

.vote-column {
    width: 48px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--space-sm);
}

.vote-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #878a8c;
    font-size: 1.125rem;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.vote-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.vote-btn.up.active {
    color: #cc3700;
}

.vote-btn.up:hover {
    color: #cc3700;
}

.vote-btn.down.active {
    color: #7193ff;
}

.vote-btn.down:hover {
    color: #7193ff;
}

.vote-score {
    font-size: 0.75rem;
    font-weight: 700;
    margin: 4px 0;
    color: #1a1a1b;
}

.content-column {
    flex: 1;
    padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-sm);
}

.post-meta {
    font-size: 0.75rem;
    color: #787c7e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    line-height: 1.2;
}

.subreddit {
    font-weight: 700;
    color: #1c1c1c;
}

.post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-image {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    background: #0000000d;
    border-radius: 8px;
    overflow: hidden;
    max-height: 500px;
}

.post-image img {
    max-height: 500px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.post-text-preview {
    font-size: 0.875rem;
    color: #1c1c1c;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-actions {
    display: flex;
    gap: var(--space-xs);
    margin-top: 4px;
}

.action-btn {
    background: transparent;
    border: none;
    color: #878a8c;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Saved/Bookmark button styling */
.action-btn.saved,
.action-btn.saved:hover {
    color: #ff4500;
}

/* Fix line-clamp compatibility */
.post-text-preview {
    font-size: 0.875rem;
    color: #1c1c1c;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Comment vote buttons (smaller for threaded comments) */
.comment-vote-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #878a8c;
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.comment-vote-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.comment-vote-btn.up.active,
.comment-vote-btn.up:hover {
    color: #ff4500;
    background: rgba(255, 69, 0, 0.1);
}

.comment-vote-btn.down.active,
.comment-vote-btn.down:hover {
    color: #7193ff;
    background: rgba(113, 147, 255, 0.1);
}

.comment-score {
    font-size: 0.7rem;
    font-weight: 700;
    color: #878a8c;
    text-align: center;
    min-width: 20px;
}

.comment-score.positive {
    color: #ff4500;
}

.comment-score.negative {
    color: #7193ff;
}

/* =============================================
   Kabar Gallery Styles
   ============================================= */
.kabar-gallery {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
}

.kabar-gallery.single {
    grid-template-columns: 1fr;
}

.kabar-gallery.multi {
    grid-template-columns: repeat(2, 1fr);
}

.kabar-gallery .gallery-item {
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kabar-gallery.single .gallery-item {
    max-height: 400px;
}

.kabar-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.2s;
}

.kabar-gallery .gallery-item img:hover {
    opacity: 0.9;
}

/* =============================================
   Community Comments Styles (kabarin.php)
   ============================================= */
.community-comment {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 8px;
}

.community-comment:hover {
    border-color: #dee2e6;
}

.community-comment .comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.community-comment .comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.community-comment .comment-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1a1a1b;
}

.community-comment .comment-time {
    font-size: 0.75rem;
    color: #787c7e;
}

.community-comment .comment-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #1c1c1c;
}

.community-comment .comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.community-comment .comment-actions button {
    font-size: 0.75rem;
    color: #878a8c;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.community-comment .comment-actions button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1b;
}

/* Space between comments */
#commentsList>.comment-item,
#commentsList>.community-comment {
    margin-bottom: 12px;
}

#commentsList>.comment-item:last-child,
#commentsList>.community-comment:last-child {
    margin-bottom: 0;
}

/* =============================================
   CONSOLIDATED: Vote & Saved Active States
   ============================================= */

/* Universal upvote active (orange) */
.vote-btn.upvote.active,
.vote-btn.up.active {
    color: var(--color-primary) !important;
    background: rgba(220, 38, 38, 0.1) !important;
}

.vote-btn.upvote:hover,
.vote-btn.up:hover {
    color: var(--color-primary);
    background: rgba(220, 38, 38, 0.08);
}

/* Universal downvote active (blue) */
.vote-btn.downvote.active,
.vote-btn.down.active {
    color: var(--color-secondary) !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

.vote-btn.downvote:hover,
.vote-btn.down:hover {
    color: var(--color-secondary);
    background: rgba(37, 99, 235, 0.08);
}

/* Vote score color when active */
.vote-score.positive {
    color: var(--color-primary) !important;
}

.vote-score.negative {
    color: var(--color-secondary) !important;
}

/* Saved/Bookmark active state (orange) */
.action-btn.saved,
.action-btn.saved:hover,
.action-btn.saved i {
    color: var(--color-primary) !important;
}

/* =============================================
   MOBILE RESPONSIVE: Cards & Layout
   ============================================= */

@media (max-width: 768px) {

    /* Report cards: stack vertically, vote at bottom */
    .report-card {
        flex-direction: column;
        overflow: hidden;
        word-break: break-word;
    }

    .vote-sidebar {
        flex-direction: row;
        min-width: unset;
        width: 100%;
        padding: 6px 12px;
        gap: 4px;
        order: 2;
        /* Move vote to bottom */
        border-top: 1px solid var(--color-border);
        border-bottom: none;
    }

    .vote-sidebar .vote-btn {
        width: 28px;
        height: 28px;
    }

    .report-content {
        padding: 10px 12px !important;
        order: 1;
        /* Content first */
    }

    /* Reddit-style cards: stack vertically, vote at bottom */
    .reddit-card {
        flex-direction: column;
        overflow: hidden;
        word-break: break-word;
    }

    .vote-column {
        flex-direction: row;
        width: 100%;
        padding: 6px 12px;
        gap: 4px;
        order: 2;
        /* Move vote to bottom */
        border-top: 1px solid #e5e7eb;
        border-bottom: none;
    }

    .vote-column .vote-btn {
        width: 28px;
        height: 28px;
    }

    .content-column {
        padding: 10px 12px !important;
        order: 1;
        /* Content first */
    }

    /* Post title smaller on mobile */
    .post-title {
        font-size: 1rem;
    }

    /* Post actions wrap */
    .post-actions {
        flex-wrap: wrap;
        gap: 4px;
    }

    .post-actions .action-btn {
        font-size: 0.7rem;
        padding: 4px 6px;
    }

    /* Images: full width on mobile */
    .post-image {
        max-height: 300px;
    }

    .post-image img {
        max-height: 300px;
    }

    /* Comment thread indent smaller */
    .community-comment {
        margin-left: 8px !important;
    }

    .community-comment .comment-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Report meta text wrap */
    .post-meta {
        font-size: 0.65rem;
    }

    /* Modal adjustments */
    .modal {
        max-width: 95vw !important;
        margin: 10px;
    }

    /* Header search hidden on mobile (already handled) */
}

@media (max-width: 480px) {

    /* Even smaller screens */
    .report-card,
    .reddit-card {
        border-radius: 0;
        margin-left: -1px;
        margin-right: -1px;
    }

    .post-title {
        font-size: 0.9rem;
    }

    .action-btn {
        font-size: 0.65rem !important;
        padding: 3px 5px !important;
    }

    .action-btn span {
        display: none;
    }

    /* Hide action text, show only icons */
    .action-btn i {
        margin: 0;
    }
}
