/* ========================================
   NEWS SIDEBAR - ULTRA MODERN & MINIMAL
   ======================================== */

/* Overlay */
.news-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Container */
.news-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 681px;
    height: 100vh;
    background: #1a1f2e;
    border-left: 1px solid #2a3142;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
}

.news-sidebar.show {
    transform: translateX(0);
}

/* ========================================
   HEADER
   ======================================== */

.news-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #2a3142;
    background: #1a1f2e;
}

.news-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.news-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0089d3 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.news-title {
    font-size: 24px;
    font-weight: 600;
    color: #e8eaed;
    margin: 0;
    line-height: 1.2;
}

.news-subtitle {
    font-size: 14px;
    color: #7e8ba3;
    margin: 2px 0 0 0;
    line-height: 1;
}

.news-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #2a3142;
    border-radius: 8px;
    color: #7e8ba3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.news-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgb(255 60 60 / 54%);
    color: rgb(255 60 60 / 54%);
}

/* New Items Notification Badge */
.news-new-notification {
    position: absolute;
    top: 50%;
    right: 60px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgb(16 185 129 / 67%) 0%, #059669 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    animation: slideInBadge 0.3s ease-out;
    display: none;
    transition: opacity 0.3s ease;
}

@keyframes slideInBadge {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* ========================================
   CONTENT
   ======================================== */

.news-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Custom Scrollbar */
.news-content::-webkit-scrollbar {
    width: 4px;
}

.news-content::-webkit-scrollbar-track {
    background: transparent;
}

.news-content::-webkit-scrollbar-thumb {
    background: rgba(126, 139, 163, 0.3);
    border-radius: 2px;
}

.news-content::-webkit-scrollbar-thumb:hover {
    background: rgba(126, 139, 163, 0.5);
}

/* News List */
.news-list {
    display: flex;
    flex-direction: column;
}

/* ========================================
   NEWS ITEM
   ======================================== */

.news-item {
    position: relative;
    background: #0f1419;
    border-bottom: 1px solid #2a3142;
    transition: background 0.2s ease;
}

.news-item:hover {
    background: #151a24;
}

.news-item:first-child {
    border-top: none;
}

/* News Actions (Favorite & Dismiss) */
.news-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.news-item:hover .news-actions {
    opacity: 1;
}

/* Favorite Button */
.news-favorite {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: #7e8ba3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.news-favorite:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #f59e0b;
}

.news-favorite.favorited {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #f59e0b;
}

.news-favorite.favorited:hover {
    background: rgba(245, 158, 11, 0.25);
}

/* Dismiss Button */
.news-dismiss {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: #7e8ba3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.news-dismiss:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgb(255 60 60 / 54%);
    color: rgb(255 60 60 / 54%);
}

/* News Link */
.news-link {
    display: block;
    padding: 20px 20px 20px 24px;
    text-decoration: none;
    color: inherit;
    position: relative;
}

/* News Content Wrapper */
.news-content-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* News Image */
.news-image {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: #2a3142;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-item:hover .news-image img {
    transform: scale(1.05);
}

/* News Text Content */
.news-text-content {
    flex: 1;
    min-width: 0;
}

/* Priority Bar (left accent) */
.news-priority-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #0089d3;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.news-item:hover .news-priority-bar {
    opacity: 1;
}

/* Priority Colors */
.news-item.priority-critical .news-priority-bar {
    background: linear-gradient(180deg, #dc2626, #991b1b);
}

.news-item.priority-high .news-priority-bar {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.news-item.priority-medium .news-priority-bar {
    background: linear-gradient(180deg, #0089d3, #764ba2);
}

.news-item.priority-info .news-priority-bar,
.news-item.priority-low .news-priority-bar {
    background: linear-gradient(180deg, rgb(16 185 129 / 67%), #059669);
}

/* ========================================
   NEWS META
   ======================================== */

.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.news-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.1);
    color: #0089d3;
}

.news-badge-urgent {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
    animation: pulse-urgent 2s infinite;
}

@keyframes pulse-urgent {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.news-badge-urgent i {
    font-size: 10px;
}

.news-time {
    font-size: 12px;
    color: #7e8ba3;
    margin-left: auto;
}

/* ========================================
   NEWS CONTENT
   ======================================== */

.news-headline {
    font-size: 17px;
    font-weight: 600;
    color: #e8eaed;
    line-height: 1.4;
    margin: 0 0 8px 0;
    transition: color 0.2s ease;
}

.news-item:hover .news-headline {
    color: #ffffff;
}

/* Priority Color Accents on Hover */
.news-item.priority-critical:hover .news-headline {
    color: #fca5a5;
}

.news-item.priority-high:hover .news-headline {
    color: #fcd34d;
}

.news-item.priority-medium:hover .news-headline {
    color: #a5b4fc;
}

.news-item.priority-info:hover .news-headline,
.news-item.priority-low:hover .news-headline {
    color: #6ee7b7;
}

.news-summary {
    font-size: 14px;
    color: #7e8ba3;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.news-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.news-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #7e8ba3;
}

.news-source i {
    font-size: 11px;
    opacity: 0.5;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.news-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.news-empty-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0089d3 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.news-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #e8eaed;
    margin: 0 0 8px 0;
}

.news-empty-text {
    font-size: 14px;
    color: #7e8ba3;
    margin: 0;
    line-height: 1.5;
}

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

.news-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #2a3142;
    background: #1a1f2e;
}

.news-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #7e8ba3;
    font-weight: 500;
}

.news-status-dot {
    width: 8px;
    height: 8px;
    background: rgb(16 185 129 / 67%);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

.news-count {
    font-size: 12px;
    color: #7e8ba3;
    font-weight: 500;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .news-sidebar {
        width: 100%;
        max-width: 380px;
    }
}

@media (max-width: 480px) {
    .news-sidebar {
        width: 100%;
        max-width: none;
    }

    .news-header {
        padding: 20px;
    }

    .news-link {
        padding: 16px 16px 16px 20px;
    }

    .news-content-wrapper {
        flex-direction: column;
    }

    .news-image {
        width: 100%;
        height: 140px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

.news-item {
    animation: slideIn 0.3s ease backwards;
}

.news-item:nth-child(1) { animation-delay: 0.05s; }
.news-item:nth-child(2) { animation-delay: 0.1s; }
.news-item:nth-child(3) { animation-delay: 0.15s; }
.news-item:nth-child(4) { animation-delay: 0.2s; }
.news-item:nth-child(5) { animation-delay: 0.25s; }

/* New item animation (for real-time updates) */
.news-item-new {
    animation: slideInFromTop 0.5s ease-out forwards !important;
    animation-delay: 0s !important;
}

/* ========================================
   LOADING & ERROR STATES
   ======================================== */

.news-loading,
.news-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.news-loading i {
    font-size: 32px;
    color: #0089d3;
    margin-bottom: 16px;
}

.news-loading p {
    font-size: 14px;
    color: #7e8ba3;
    margin: 0;
}

.news-error i {
    font-size: 32px;
    color: rgb(255 60 60 / 54%);
    margin-bottom: 16px;
}

.news-error p {
    font-size: 14px;
    color: #7e8ba3;
    margin: 0;
}
