/* Base styles */
.egx-news-wrapper {
    box-sizing: border-box;
    position: relative;
}

.egx-news-wrapper *,
.egx-news-wrapper *:before,
.egx-news-wrapper *:after {
    box-sizing: inherit;
}

/* Loading state */
.egx-news-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.egx-news-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(0, 102, 204, 0.1);
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: egx-news-spin 0.8s linear infinite;
}

@keyframes egx-news-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Filter Controls */
.egx-news-filters {
    margin-bottom: 2rem;
}

.egx-news-filters__fields-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.egx-news-filter select {
    padding: 1rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #fff;
    font-size: 1.5rem;
    color: #374151;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    min-width: 30rem;
}

.egx-news-filter select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Type Tags */
.egx-news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}

.egx-news-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
}

.egx-news-type-news {
    background-color: #e0f2fe;
    color: #0369a1;
}

.egx-news-type-consolidated_report {
    background-color: #fef3c7;
    color: #92400e;
}

.egx-news-type-standalone_report {
    background-color: #d1fae5;
    color: #047857;
}

.egx-news-type-annual_report {
    background-color: #f3e8ff;
    color: #7e22ce;
}

/* Section Tags */
.egx-news-section-General {
    background-color: #e5e7eb;
    color: #374151;
}

.egx-news-section-Corporate_Actions {
    background-color: #dbeafe;
    color: #1e40af;
}

.egx-news-section-General_Assemblies {
    background-color: #fce7f3;
    color: #9d174d;
}

.egx-news-section-Financial_Results {
    background-color: #d1fae5;
    color: #065f46;
}

.egx-news-section-Insider_Trading_Executions {
    background-color: #fef3c7;
    color: #92400e;
}

.egx-news-section-Treasury_Stocks {
    background-color: #fee2e2;
    color: #991b1b;
}

.egx-news-section-Trading_Notices {
    background-color: #e0e7ff;
    color: #3730a3;
}

.egx-news-section-Listing_Announcements {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.egx-news-section-Finanical_Statements {
    background-color: #ffedd5;
    color: #9a3412;
}

.egx-news-section-Shareholding_Structure {
    background-color: #ddd6fe;
    color: #5b21b6;
}

.egx-news-cta {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 24px;
}
/* Pagination */
.egx-news-pagination {
    margin-top: 8rem;
}

.egx-news-pagination ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 1.2rem;
}

.egx-news-pagination a,
.egx-news-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    padding: 0 0.75rem;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 1.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.egx-news-pagination a:hover {
    background-color: #f8fafc;
    border-color: #d1d5db;
    color: #1f2937;
}

.egx-news-pagination .current {
    background-color: #0066cc;
    border-color: #0066cc;
    color: #ffffff;
}

/* Error States */
.egx-news-error {
    padding: 1rem;
    margin: 1rem 0;
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 6px;
    color: #991b1b;
}

/* RTL Support */
[dir="rtl"] .egx-news-filter select {
    background-position: left 1rem center;
}

[dir="rtl"] .egx-news-item {
    text-align: right;
}

/* Print Styles */
@media print {
    .egx-news-filters,
    .egx-news-pagination {
        display: none !important;
    }

    .egx-news-item {
        break-inside: avoid;
    }
}

/* Shared item styles */
/* Item styles */
.egx-news-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.egx-news-date {
    display: block;
    color: #6b7280;
    font-size: 18px;
    margin-bottom: 18px;
}

.egx-news-title {
    font-size: 24px;
    line-height: 1.5;
    margin-bottom: 18px;
    color: #1f2937;
}

.egx-news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.egx-news-title a:hover {
    color: #0066cc;
}

.egx-news-excerpt {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Empty state */
.egx-news-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6b7280;
}
