html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE047 20%, #FB923C 50%, #F472B6 80%, #E879F9 100%);
    color: #111827;
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

/* Modern Vibrant Color Palette */
:root {
    --gradient-start: #FEF3C7;
    --gradient-yellow: #FDE047;
    --gradient-orange: #FB923C;
    --gradient-pink: #F472B6;
    --gradient-purple: #E879F9;
    --primary-color: #000000;
    --primary-dark: #111827;
    --primary-light: #374151;
    --secondary-color: #F472B6;
    --accent-color: #FDE047;
    --success-color: #10b981;
    --warning-color: #FB923C;
    --error-color: #dc2626;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --background-light: #ffffff;
    --background-subtle: #f9fafb;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
}

a, .btn-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, .btn-link:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.btn-primary {
    color: #ffffff;
    background: #000;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: #1f2937;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

.content {
    padding-top: 1.1rem;
    background-color: var(--background-light);
    min-height: calc(100vh - 4rem);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    color: #000;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* Card and container styling with improved contrast */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
    border-color: rgba(244, 114, 182, 0.4);
}

.card-header {
    background: var(--background-subtle);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
}

h1:focus {
    outline: none;
}

p {
    margin-bottom: 1rem;
    color: #4a5568;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjb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TkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
    margin: 1rem;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* AI News Analysis Styles */
.analysis-container {/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Smooth animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
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AyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* AI News Analysis Styles */
.analysis-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
}

.analysis-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 1rem;
}

.analysis-header h2 {
    color: #1f2937;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.analysis-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.analysis-meta .date,
.analysis-meta .category {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.analysis-content {
    line-height: 1.8;
    color: #374151;
    font-size: 1.05rem;
}

.formatted-content h3 {
    color: #1f2937;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
}

.formatted-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.formatted-content li {
    margin: 0.5rem 0;
    list-style-type: disc;
}

.formatted-content strong {
    color: #1f2937;
    font-weight: 600;
}

.formatted-content p {
    margin: 1rem 0;
}

/* AI News Tiles Styles */
.ai-news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.header-content {
    flex: 1;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.page-icon {
    font-size: 2rem;
}

.page-subtitle {
    color: #6b7280;
    font-size: 1.1rem;
    margin: 0;
}

.header-actions {
    margin-left: 2rem;
}

.news-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.news-tile {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.news-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.news-tile.read {
    opacity: 0.8;
    background: #f8fafc;
}

.news-tile.read::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #10b981;
}

.tile-header {
    margin-bottom: 1rem;
}

.tile-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.tile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #6b7280;
}

.tile-category {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.tile-date {
    font-weight: 500;
}

.tile-content {
    margin-bottom: 1rem;
}

.tile-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tile-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.btn-outline-primary {
    color: #3b82f6;
    border: 1px solid #3b82f6;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #3b82f6;
    color: white;
}

.btn-outline-secondary {
    color: #6b7280;
    border: 1px solid #d1d5db;
    background: transparent;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.tile-detail-modal .modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tile-detail-modal .modal-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
    flex: 1;
    padding-right: 1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 2rem;
}

.tile-detail-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.875rem;
}

.date-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.875rem;
}

.tile-detail-content {
    margin-bottom: 2rem;
}

.tile-detail-tags h4 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags-list .tag {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.5rem 1rem;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.modal-actions {
    padding: 1rem 2rem 2rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 2rem;
}

/* Loading States */
.loading-container {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-news-container {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-actions {
        margin-left: 0;
        align-self: stretch;
    }
    
    .news-tiles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .news-tile {
        padding: 1rem;
    }
    
    .modal-overlay {
        padding: 1rem;
    }
    
    .tile-detail-modal .modal-header,
    .modal-body,
    .modal-actions {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* AI Summary Generating Animation */
.ai-summary-text.generating {
    background: linear-gradient(90deg, #f8fafc 0%, #e2e8f0 50%, #f8fafc 100%);
    border-left: 4px solid #e94560;
    padding: 1rem;
    border-radius: 8px;
    font-style: italic;
    color: #4a5568;
    position: relative;
    overflow: hidden;
}

.ai-summary-text.generating::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(233, 69, 96, 0.1), transparent);
    animation: shimmer 2s infinite;
}

.generating-animation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.ai-summary-content {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ai-summary-text {
    margin: 0;
    padding: 0.75rem 0;
    color: #4a5568;
    line-height: 1.6;
}

