/* Modern News Website Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #1a1a1a;
  --secondary-color: #dc2626;
  --accent-color: #f59e0b;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
}

/* Header Styles */
header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

/* Authentication Buttons */
.user-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}

.auth-btn i {
  font-size: 0.875rem;
}

.auth-btn-login {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.auth-btn-login:hover {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.auth-btn-register {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.auth-btn-register:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Authenticated User Section */
.auth-user-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-dashboard-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid transparent;
}

.auth-dashboard-link.admin-link {
  background: rgba(220, 38, 38, 0.1);
  color: var(--secondary-color);
  border-color: rgba(220, 38, 38, 0.2);
}

.auth-dashboard-link.admin-link:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.auth-dashboard-link.user-link {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

.auth-dashboard-link.user-link:hover {
  background: #3b82f6;
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.auth-logout-form {
  display: inline;
  margin: 0;
}

.auth-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.875rem;
  background: transparent;
  color: #ef4444;
  border: 2px solid rgba(239, 68, 68, 0.2);
  cursor: pointer;
  transition: var(--transition);
}

.auth-logout-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.auth-logout-btn i {
  font-size: 0.875rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 50px;
  width: auto;
}

.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-left: 0.5rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Social Icons */
.sm-icons {
  display: flex;
  gap: 0.75rem;
}

.sm-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: var(--transition);
}

.sm-icons a:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
}

/* Search Form */
.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 25px;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.search-form:focus-within {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.search-form input {
  border: none;
  background: transparent;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  width: 200px;
  outline: none;
}

.search-form input::placeholder {
  color: var(--text-light);
}

.search-form button {
  background: var(--secondary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.search-form button:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* Navigation */
.navbar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 1rem 0;
}

.nav-menu li a {
  font-weight: 500;
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
}

.nav-menu li a:hover {
  background: var(--bg-secondary);
  color: var(--secondary-color);
}

.nav-menu li a.active {
  color: var(--secondary-color);
  background: var(--bg-secondary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle div {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile Responsive Auth Buttons */
@media (max-width: 768px) {
  .user-auth {
    gap: 0.5rem;
  }
  
  .auth-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .auth-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  
  .auth-btn span {
    display: none;
  }
  
  .auth-btn i {
    margin: 0;
  }
  
  .auth-user-section {
    gap: 0.5rem;
  }
  
  .auth-dashboard-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .auth-dashboard-link span {
    display: none;
  }
  
  .auth-logout-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .auth-logout-btn span {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-right {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
  }
  
  .user-auth {
    order: -1;
  }
  
  .auth-buttons {
    flex-direction: row;
    gap: 0.5rem;
  }
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background: var(--bg-primary);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  transition: var(--transition);
  z-index: 1001;
  overflow-y: auto;
}

.sidebar.open {
  left: 0;
}

.sidebar ul {
  list-style: none;
  margin-top: 0;
}

.sidebar ul li {
  margin-bottom: 0.5rem;
}

.sidebar ul li a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.sidebar ul li a:hover {
  background: var(--bg-secondary);
  color: var(--secondary-color);
}

/* Sidebar Authentication */
.sidebar-auth {
  padding: 1rem 0;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

.user-avatar {
  font-size: 2rem;
  color: var(--secondary-color);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.user-email {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sidebar-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
  background: transparent;
  font-size: 0.9rem;
  width: 100%;
  text-align: left;
}

.sidebar-btn i {
  font-size: 1rem;
  width: 20px;
}

.sidebar-btn.login-btn {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.sidebar-btn.login-btn:hover {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.sidebar-btn.register-btn {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.sidebar-btn.register-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.sidebar-btn.admin-btn {
  background: rgba(220, 38, 38, 0.1);
  color: var(--secondary-color);
  border-color: rgba(220, 38, 38, 0.2);
}

.sidebar-btn.admin-btn:hover {
  background: var(--secondary-color);
  color: white;
}

.sidebar-btn.user-btn {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

.sidebar-btn.user-btn:hover {
  background: #3b82f6;
  color: white;
}

.sidebar-btn.logout-btn {
  background: transparent;
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.sidebar-btn.logout-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.sidebar-logout-form {
  margin: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: var(--bg-secondary);
  color: var(--secondary-color);
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
}

.overlay.show {
  display: block;
}

/* Main Content */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Grid Layouts */
.grid-container1 {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.grid-container2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* News Cards */
.news-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

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

.news-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.news-card-content {
  padding: 1.5rem;
}

.news-card-category {
  display: inline-block;
  background: var(--secondary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.news-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.news-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

.news-card-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Featured Story */
.featured-story {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--primary-color) 0%, #374151 100%);
  color: white;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  position: relative;
}

.featured-story::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(220, 38, 38, 0.8) 0%, rgba(245, 158, 11, 0.8) 100%);
  opacity: 0.9;
}

.featured-story-content {
  position: relative;
  z-index: 2;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 400px;
}

.featured-story-category {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: inline-block;
  backdrop-filter: blur(10px);
}

.featured-story-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.featured-story-excerpt {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-link {
  color: var(--secondary-color);
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Trending Sidebar */
.trending-sidebar {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  height: fit-content;
}

.trending-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  align-items: flex-start;
}

.trending-item:last-child {
  border-bottom: none;
}

.trending-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary-color);
  min-width: 2rem;
  flex-shrink: 0;
}

.trending-image {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.trending-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.trending-content {
  flex: 1;
  min-width: 0;
}

.trending-content h4 {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trending-content h4 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.trending-content h4 a:hover {
  color: var(--secondary-color);
}

.trending-content p {
  font-size: 0.75rem;
  color: var(--text-light);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .grid-container1 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .grid-container2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .header-right {
    flex-direction: column;
    gap: 1rem;
  }
  
  .search-form input {
    width: 150px;
  }
  
  .nav-container {
    padding: 0 1rem;
  }
  
  .nav-menu {
    display: none;
  }
  
  .menu-toggle {
    display: flex;
  }

  .main-container {
    padding: 1rem;
  }
  
  .grid-container2 {
    grid-template-columns: 1fr;
  }
  
  .featured-story-content {
    padding: 2rem;
    min-height: 300px;
  }
  
  .featured-story-title {
    font-size: 1.75rem;
  }
  
  .news-card-content {
    padding: 1rem;
  }
  
  .news-card-title {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .featured-story-content {
    padding: 1.5rem;
  }
  
  .featured-story-title {
    font-size: 1.5rem;
  }
  
  .news-card-content {
    padding: 0.75rem;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--secondary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fade In Animation */
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

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