/* ============================================
   NEWSPORTAL UI/UX ENHANCEMENTS
   Modern, Beautiful, Professional Design
   ============================================ */

/* ============================================
   SMOOTH ANIMATIONS & TRANSITIONS
   ============================================ */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Page transitions */
body {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   ENHANCED CARDS WITH HOVER EFFECTS
   ============================================ */
.news-card {
  position: relative;
  transition: all var(--transition-base);
  overflow: hidden;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  z-index: 0;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.news-card:hover::before {
  opacity: 1;
}

.news-card:active {
  transform: translateY(-2px);
}

/* Image zoom on hover */
.news-card img {
  transition: transform var(--transition-slow);
}

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

/* ============================================
   GLASSMORPHISM EFFECTS
   ============================================ */
.glass-effect {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-effect {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   ENHANCED BUTTONS
   ============================================ */
button,
.btn,
a.btn {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

button::before,
.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:active::before,
.btn:active::before {
  width: 300px;
  height: 300px;
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button:active,
.btn:active {
  transform: translateY(0);
}

/* ============================================
   IMPROVED TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  background: linear-gradient(135deg, var(--color-gray-900) 0%, var(--color-gray-700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dark h1 {
  background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

p {
  line-height: 1.7;
  color: var(--color-gray-700);
}

.dark p {
  color: var(--color-gray-300);
}

/* ============================================
   ENHANCED LINKS
   ============================================ */
a {
  position: relative;
  transition: color var(--transition-base);
}

a:not(.btn):not(.news-card)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition-base);
}

a:not(.btn):not(.news-card):hover::after {
  width: 100%;
}

/* ============================================
   LOADING STATES & SKELETONS
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-200) 25%,
    var(--color-gray-100) 50%,
    var(--color-gray-200) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================
   ENHANCED FORMS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
  transition: all var(--transition-base);
  border: 2px solid var(--color-gray-200);
}

input:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge,
.tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.badge:hover,
.tag:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* Category badges with gradient */
.category-badge {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Floating animation */
.float {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ============================================
   ENHANCED SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 10px;
  border: 2px solid var(--color-gray-100);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
}

/* ============================================
   TOOLTIPS
   ============================================ */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.5rem 0.75rem;
  background: var(--color-gray-900);
  color: white;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  z-index: 1000;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-gray-900);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
}

/* ============================================
   ENHANCED HEADER
   ============================================ */
header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  transition: all var(--transition-base);
}

header.scrolled {
  box-shadow: var(--shadow-lg);
}

.dark header {
  background: rgba(30, 41, 59, 0.95);
}

/* ============================================
   GRADIENT OVERLAYS
   ============================================ */
.gradient-overlay {
  position: relative;
}

.gradient-overlay::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  pointer-events: none;
}

/* ============================================
   ENHANCED WIDGETS
   ============================================ */
.widget {
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.widget::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.5s;
}

.widget:hover::before {
  left: 100%;
}

/* ============================================
   FOCUS STATES (ACCESSIBILITY)
   ============================================ */
*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
}

/* ============================================
   RESPONSIVE IMAGES
   ============================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-cover {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* ============================================
   GRID ENHANCEMENTS
   ============================================ */
.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.grid-auto-fill {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-glow {
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

.backdrop-blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 768px) {
  .news-card:hover {
    transform: none;
  }
  
  .news-card:active {
    transform: scale(0.98);
  }
  
  h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .news-card {
    box-shadow: none !important;
    border: 1px solid var(--color-gray-300);
  }
  
  .news-card:hover {
    transform: none;
  }
}

/* ============================================
   REDUCED MOTION (ACCESSIBILITY)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
