* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #1c1e21;
}

/* Header */
header {
    background-color: #000;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo span {
    background-color: #ff3b30;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 5px;
}

.search-bar {
    flex-grow: 0.3;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #dddfe2;
    background-color: #f0f2f5;
    font-size: 14px;
}

/* User Profile Picture */
.profile-picture {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #dddfe2;
    vertical-align: middle;
    margin-left: 6px;
}

/* Header User Profile */
.user-profile {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.user-name {
    margin-left: 6px;
    font-size: 14px;
    vertical-align: middle;
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input::placeholder {
    color: #8a8d91;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.current-time {
    font-size: 14px;
    margin-left: 15px;
    color: #ccc;
}

.action-btn {
    padding: 8px 12px;
    border-radius: 20px;
    background-color: #e4e6eb;
    color: #050505;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #d8dadf;
}

.action-btn.primary {
    background-color: #ff3b30;
    color: white;
}

.action-btn.primary:hover {
    background-color: #d82d25;
}

.action-btn.admin {
    background-color: #28a745;
    color: white;
    font-weight: bold;
    border: 2px solid #1e7e34;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-btn.admin:hover {
    background-color: #218838;
    border-color: #1c7430;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Breaking News Bar */
.breaking-news-container {
    background-color: #ff3b30;
    color: white;
    overflow: hidden;
    position: relative;
    height: 40px;
    direction: rtl;
}


.breaking-label {
    position: absolute;
    background-color: #000;
    color: white;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-weight: bold;
    z-index: 2;
    right: 0; /* ׳‘׳׳§׳•׳ left: 0 */
}

.news-scroller {
    position: absolute;
    white-space: nowrap;
    animation: scroll-ltr 300s linear infinite;
    animation-play-state: running;
    padding-right: 120px;
    padding-left: 20px;
    line-height: 40px;
    direction: rtl; /* ׳”׳•׳¡׳₪׳× ׳›׳™׳•׳•׳ RTL ׳׳˜׳§׳¡׳˜ */
}

.breaking-news-container:hover .news-scroller {
    animation-play-state: paused;
}

@keyframes scroll-ltr {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Filter Bar */
.filter-bar {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: var(--filter-bar-top, var(--header-height, 60px));
    z-index: 1003;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: top 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Default header height for index page */
body {
    --header-height: 120px; /* Header + ticker */
}

/* Header height for report mode */
body.report-mode {
    --header-height: 60px; /* Will be calculated dynamically */
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.filter-scroll-container {
    flex: 1;
    max-width: 90%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.filter-scroll-container::-webkit-scrollbar {
    display: none;
}

.filter-buttons {
    display: flex;
    gap: 12px;
    direction: rtl;
    padding-bottom: 4px;
}

.filter-nav-arrow {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4), 0 2px 8px rgba(0,0,0,0.1);
    color: white;
    font-size: 22px;
    font-weight: bold;
    user-select: none;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.filter-nav-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.filter-nav-arrow:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6), 0 4px 15px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.filter-nav-arrow:hover::before {
    left: 100%;
}

.filter-nav-arrow:hover span {
    animation: arrowBounce 0.6s ease-in-out;
}

.filter-nav-arrow:active {
    transform: scale(1.05);
    transition: all 0.1s;
}

.filter-nav-arrow span {
    display: inline-block;
    transition: all 0.3s ease;
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(3px);
    }
}

.filter-nav-left:hover span {
    animation: arrowBounceLeft 0.6s ease-in-out;
}

@keyframes arrowBounceLeft {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-3px);
    }
}

.filter-nav-arrow.disabled {
    background: linear-gradient(135deg, #e0e0e0 0%, #cccccc 100%);
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-nav-arrow.disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-scroll-container {
    order: 2;
}

.filter-nav-left {
    order: 1;
}

.filter-nav-right {
    order: 3;
}

.filter-button {
    background-color: rgba(248, 249, 250, 0.8);
    color: #444;
    border: 1px solid rgba(224, 224, 224, 0.6);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.filter-button:hover {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.filter-button.active {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
    box-shadow: 0 2px 6px rgba(26,115,232,0.3);
}

.filter-button.active:hover {
    background-color: #1557b0;
    border-color: #1557b0;
    box-shadow: 0 4px 12px rgba(26,115,232,0.4);
}

/* Main Content */
.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 20px;
}

.top-news-section {
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    border-right: 4px solid #ff3b30;
}

.top-news-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.top-news-content {
    padding: 20px;
}

.news-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 10px;
    margin: 0 auto;
    max-width: 800px;
    direction: rtl;
}

.news-post {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 1;
    margin-bottom: 20px;
    width: 100%;
}

.post-header {
    padding: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.source-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #ff3b30;
}

.post-info {
    flex-grow: 1;
}

.source-name {
    font-weight: bold;
    color: #1c1e21;
    display: flex;
    align-items: center;
}

.post-time {
    font-size: 13px;
    color: #65676b;
}

.post-content {
    padding: 2px 15px 15px 15px; /* ׳”׳§׳˜׳ ׳× ׳”׳₪׳“׳™׳ ׳’ ׳”׳¢׳׳™׳•׳ ׳-7px ׳-2px */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px; /* ׳”׳§׳˜׳ ׳× ׳”׳¨׳•׳•׳— ׳‘׳™׳ ׳׳׳׳ ׳˜׳™׳ ׳-10px ׳-5px */
}

.post-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.post-desc {
    white-space: pre-line; /* This will respect line breaks */
    line-height: 1.5;
    margin: 10px 0;
    font-size: 16px;
    color: #333;
}

.post-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin-top: 10px;
}

.post-footer {
    border-top: 1px solid #dddfe2;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
}

.feedback-action {
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.feedback-action:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.feedback-action.selected-reaction {
    background-color: rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.feedback-action.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    color: #999;
}

.feedback-action.disabled:hover {
    background-color: transparent;
    opacity: 0.5;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    margin-top: auto;
}

.news-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-time::before {
    content: "נ•’";
}

.news-category {
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* New Post Indicator */
.new-posts-indicator {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff3b30;
    color: white;
    padding: 8px 15px;
    border-radius: 30px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 90;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* New posts notification */
.new-posts-notification {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    background: #0066ff;
    color: white;
    padding: 6px 30px; /* ׳”׳§׳˜׳ ׳× ׳’׳•׳‘׳” ׳¢"׳™ ׳”׳§׳˜׳ ׳× padding ׳¢׳׳™׳•׳ ׳•׳×׳—׳×׳•׳, ׳”׳’׳“׳׳× ׳¨׳•׳—׳‘ ׳¢"׳™ ׳”׳’׳“׳׳× padding ׳¦׳“׳“׳™ */
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-weight: 700;
    font-size: 14px; /* ׳”׳§׳˜׳ ׳× ׳’׳•׳“׳ ׳”׳’׳•׳₪׳ */
    cursor: pointer;
    z-index: 1000;
    display: none;
    transition: all 0.3s ease;
    pointer-events: auto; /* ensure clickable */
    white-space: nowrap; /* ׳”׳˜׳§׳¡׳˜ ׳™׳™׳©׳׳¨ ׳‘׳©׳•׳¨׳” ׳׳—׳× */
    line-height: 1.2; /* ׳”׳§׳˜׳ ׳× ׳’׳•׳‘׳” ׳”׳©׳•׳¨׳” */
}

.new-posts-notification:hover {
    background: #0052cc;
    transform: translateX(-50%) scale(1.05);
}

/* Desktop position */
@media (min-width: 769px) {
    .new-posts-notification {
        top: 120px; /* Below breaking news */
    }
}

/* Mobile position */
@media (max-width: 768px) {
    .new-posts-notification {
        bottom: 40px;
    }
}

/* ׳₪׳׳•׳׳˜׳¨ ׳›׳₪׳×׳•׳¨ ׳׳—׳“׳©׳•׳× ׳—׳“׳©׳•׳× */
#new-content-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #ff3b30;
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 100;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* Loading Indicator */
#loading-indicator {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #666;
    display: none;
    grid-column: 1 / -1; /* ׳×׳•׳₪׳¡ ׳׳× ׳›׳ ׳¨׳•׳—׳‘ ׳”׳’׳¨׳™׳“ */
}

/* New Post Badge */
.new-post-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: #ff3b30;
    color: white;
    border-radius: 10px;
    font-size: 12px;
    margin-right: 5px;
    font-weight: normal;
}

/* New Alert */
.new-alert {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #ff3b30;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.5s;
    z-index: 100;
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dot {
    width: 10px;
    height: 10px;
    background-color: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

/* Emoji Reaction Buttons */
.emoji-reaction-btns {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.emoji-reaction-btn {
    padding: 8px 12px;
    border-radius: 20px;
    background-color: #e4e6eb;
    color: #050505;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.emoji-reaction-btn:hover {
    background-color: #d8dadf;
}

.emoji-reaction-btn.active {
    background-color: #ff3b30;
    color: white;
}

.emoji-reaction-btn.angry {
    background-color: #e74c3c;
    color: white;
}

.emoji-reaction-btn.haha {
    background-color: #f7dc6f;
    color: #050505;
}

.emoji-reaction-btn.like {
    background-color: #34a85a;
    color: white;
}

.emoji-reaction-btn.love {
    background-color: #ff69b4;
    color: white;
}

.emoji-reaction-btn.support {
    background-color: #8e44ad;
    color: white;
}

@media (max-width: 768px) {
    .news-feed {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    .news-post {
        margin-bottom: 15px;
    }
    .post-content {
        padding: 10px;
    }
    .post-footer {
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .header-container {
        flex-direction: column;
        align-items: center;
    }
    .logo {
        font-size: 18px;
    }
    .search-bar {
        margin-top: 10px;
    }
    .actions {
        margin-top: 10px;
    }
    .filter-bar {
        top: 100px;
    }
    .container {
        margin: 10px auto;
    }
    .top-news-section {
        margin-bottom: 10px;
    }
    .news-feed {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .news-post {
        margin-bottom: 10px;
    }
    .post-content {
        padding: 5px;
    }
    .post-footer {
        padding: 0 5px;
    }
}

/* Mobile: show newest posts at bottom, older at top */
@media (max-width: 768px) {
    .news-feed {
        display: flex !important;
        flex-direction: column-reverse !important;
    }
}

/* Smaller mobile */
@media (max-width: 480px) {
    .news-feed {
        display: flex !important;
        flex-direction: column-reverse !important;
    }
}

/* Shared News Highlight */
.shared-news-highlight {
    animation: highlightPulse 1s ease-in-out infinite alternate;
    border: 2px solid #ff3b30 !important;
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.4) !important;
    position: relative;
    z-index: 2;
}

.shared-news-highlight::before {
    content: '׳”׳™׳“׳™׳¢׳” ׳©׳‘׳™׳§׳©׳×';
    position: absolute;
    top: -15px;
    right: 10px;
    background-color: #ff3b30;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    z-index: 3;
}

.highlight-fade {
    animation: fadeOutHighlight 2s forwards;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 59, 48, 0.7);
    }
}

@keyframes fadeOutHighlight {
    0% {
        border-color: #ff3b30;
        box-shadow: 0 0 15px rgba(255, 59, 48, 0.4);
    }
    100% {
        border-color: transparent;
        box-shadow: 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* Mobile specific styles */
@media screen and (max-width: 768px) {
    /* Hide elements on mobile */
    .logo,
    .breaking-news-container,
    .filter-bar {
        display: none !important;
    }

    /* Adjust header for mobile */
    .header-container {
        padding: 5px 10px;
        justify-content: space-between;
    }

    /* Show only time and login on mobile header */
    .header-container {
        grid-template-columns: auto auto;
        gap: 10px;
    }

    #current-time {
        font-size: 0.9rem;
        margin-right: auto;
    }

    .actions {
        margin-left: auto;
    }

    /* Hide source icon and adjust source layout */
    .source-icon {
        display: none !important;
    }

    .post-header {
        padding: 8px 12px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }

    .source-name {
        font-size: 0.75rem !important;
        font-weight: 500 !important;
        margin-right: auto !important;
    }
    
    .post-time {
        font-size: 0.7rem !important;
        color: #666 !important;
    }

    /* Adjust text sizes for mobile */
    .post-title {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
        font-weight: 500 !important;
    }

    .post-desc {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
        color: #333 !important;
    }

    /* Adjust post spacing and padding */
    .news-post {
        padding: 12px !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
        transition: background-color 0.2s ease !important;
        background-color: #fff !important;
    }

    .news-post:hover {
        background-color: #f5f5f5 !important;
    }

    .post-content {
        padding: 0 !important;
    }

    .post-footer {
        padding: 8px 0 0 0 !important;
        gap: 8px !important;
        border-top: 1px solid #eee !important;
    }

    /* Adjust float button size for mobile */
    #new-content-float {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.5rem !important;
        bottom: 20px !important;
        left: 20px !important;
        right: auto !important;
        box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3) !important;
    }

    #new-content-float:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 8px rgba(255, 59, 48, 0.4) !important;
    }

    /* Adjust feedback actions size */
    .feedback-action {
        font-size: 0.8rem !important;
        padding: 4px !important;
        color: #666 !important;
    }
    .shared-news-highlight {
        border: 2px solid red !important;
        padding: 10px;
        box-sizing: border-box;
        position: relative; /* Needed for absolute positioning of the label */
    }
    
    .shared-news-label {
        position: absolute;
        top: -10px; /* Adjust as needed */
        right: 10px; /* Adjust as needed */
        background-color: red;
        color: white;
        padding: 2px 5px;
        font-size: 0.8em;
        border-radius: 3px;
        z-index: 10; /* Ensure it's above other elements */
    }
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 4px;
  color: white;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.5s;
}

.toast-info {
  background-color: #2196F3;
}

.toast-error {
  background-color: #f44336;
}

.toast-success {
  background-color: #4CAF50;
}

.toast-warning {
  background-color: #ff9800;
}

.toast.fade-out {
  opacity: 0;
}
