/* Category buttons styling */
.category-btn {
    @apply px-6 py-3 rounded-lg border-2 border-gray-200 bg-white text-gray-700 hover:bg-gray-50 hover:border-gray-300 transition-all duration-200 font-semibold text-base shadow-sm;
    min-width: 120px;
    text-align: center;
}

.category-btn.active {
    @apply bg-gradient-to-r from-orange-500 to-pink-500 text-white border-transparent shadow-lg transform scale-105;
}

/* News card styling - all cards now have consistent appearance */
.news-card {
    @apply bg-white rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 border-l-gray-300 border-l-4 overflow-hidden cursor-pointer transform hover:scale-[1.02];
    min-height: 420px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.news-card:hover {
    @apply transform translate-y-[-4px] scale-[1.02];
}

.news-card.quick-view {
    @apply p-8;
}

.news-card.full-view {
    @apply p-0;
}

/* News thumbnail styling */
.news-thumbnail {
    @apply transition-all duration-300;
}

.news-thumbnail:hover {
    @apply transform scale-[1.02];
}

.news-thumbnail-placeholder {
    @apply bg-gradient-to-br from-gray-100 to-gray-200;
    background-size: 200% 200%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}

/* Text clamping */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-6 {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Consistent card content */
.news-card .content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Ensure consistent spacing and heights */
.news-card .content-area > * {
    margin-bottom: 1rem;
}

.news-card .content-area > *:last-child {
    margin-bottom: 0;
}

/* Consistent section heights */
        .news-card .impact-section {
            min-height: 80px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        
        /* Line clamp utilities for trending news */
        .line-clamp-2 {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .line-clamp-3 {
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

.news-card .card-footer {
    margin-top: auto;
}

/* Optimized typography for smaller fonts */
.news-card .text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.news-card .text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin-bottom: 0.75rem;
}

.news-card .text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
    margin-bottom: 0.5rem;
}

/* Better content spacing */
.news-card .content-area > * {
    margin-bottom: 0.75rem;
}

.news-card .content-area > *:last-child {
    margin-bottom: 0;
}

/* Ensure crisp text rendering */
.news-card {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Enhanced card hover effects */
.news-card {
    position: relative;
    overflow: hidden;
}

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

.news-card:hover::before {
    left: 100%;
}

/* Metadata icons styling */
.news-card .metadata-icon {
    @apply transition-all duration-200;
}

.news-card:hover .metadata-icon {
    @apply transform scale-110;
}

/* Mobile swipe gestures */
@media (max-width: 768px) {
    .news-container-mobile {
        @apply overflow-x-auto snap-x snap-mandatory;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .news-container-mobile::-webkit-scrollbar {
        display: none;
    }
    
    .news-card-mobile {
        @apply min-w-full snap-center;
    }
    
    .news-card {
        min-height: 320px;
    }
}

/* Tablet split view */
@media (min-width: 768px) and (max-width: 1024px) {
    .tablet-split-view {
        @apply grid grid-cols-2 gap-6;
    }
    
    .tablet-news-list {
        @apply space-y-4;
    }
    
    .tablet-article-view {
        @apply sticky top-20;
    }
}

/* Loading states */
.loading-skeleton {
    @apply animate-pulse bg-gray-200 rounded;
}

.loading-text {
    @apply h-4 bg-gray-200 rounded animate-pulse;
}

.loading-title {
    @apply h-6 bg-gray-200 rounded animate-pulse;
}

/* Floating category selector for mobile */
.floating-category-selector {
    @apply fixed bottom-6 left-1/2 transform -translate-x-1/2 bg-white shadow-xl rounded-2xl p-3 border border-gray-200 z-40;
}

.floating-category-btn {
    @apply px-3 py-2 rounded-lg text-sm font-medium hover:bg-gray-100 transition-colors border border-transparent;
    min-width: 50px;
    text-align: center;
}

.floating-category-btn.active {
    @apply bg-gradient-to-r from-orange-500 to-pink-500 text-white border-transparent shadow-md;
}

/* Custom animations for different states */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

/* Prediction hologram effect enhancement */
.prediction-text {
    @apply relative overflow-hidden;
}

.prediction-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

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

/* Enhanced modal styling */
.modal-enter {
    animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Timeline styling for related news */
.timeline-item {
    @apply relative pl-6 pb-4;
}

.timeline-item::before {
    content: '';
    @apply absolute left-2 top-2 w-2 h-2 bg-indigo-500 rounded-full;
}

.timeline-item::after {
    content: '';
    @apply absolute left-2.5 top-4 w-0.5 h-full bg-gray-200;
}

.timeline-item:last-child::after {
    display: none;
}

/* Responsive typography */
@media (max-width: 640px) {
    .text-responsive-xl { @apply text-lg; }
    .text-responsive-lg { @apply text-base; }
    .text-responsive-base { @apply text-sm; }
}

@media (min-width: 641px) {
    .text-responsive-xl { @apply text-xl; }
    .text-responsive-lg { @apply text-lg; }
    .text-responsive-base { @apply text-base; }
}

/* Typography enhancements for better readability */
body {
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1f2937; /* Darker base text color */
}

/* Font-specific styling */
.font-headline {
    font-feature-settings: "liga" 1, "kern" 1, "calt" 1;
    letter-spacing: -0.025em;
    font-weight: 600;
}

.font-body {
    font-feature-settings: "liga" 1, "kern" 1;
    line-height: 1.7;
    letter-spacing: 0.01em;
    font-weight: 400;
}

.font-ui {
    font-feature-settings: "liga" 1, "kern" 1;
    letter-spacing: -0.01em;
    font-weight: 500;
}

.font-mono {
    font-feature-settings: "liga" 0, "kern" 1;
    letter-spacing: 0.02em;
    font-weight: 400;
}

/* Focus states for accessibility */
.category-btn:focus,
.news-card:focus,
button:focus {
    @apply outline-none ring-2 ring-indigo-500 ring-opacity-50;
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    .dark-mode-ready {
        @apply bg-gray-900 text-white;
    }
    
    .dark-mode-card {
        @apply bg-gray-800 border-gray-700;
    }
}
