/* ===================================
   Modern Professional Design System
   Mobile-First Responsive Layout
   =================================== */

:root {
  /* Color Palette */
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  
  /* Grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Container */
  --container-max: 1280px;
  --container-padding: 1rem;
}

/* ===================================
   Base Styles
   =================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

/* ===================================
   Container & Layout
   =================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.main-content {
  flex: 1;
  padding-top: var(--space-6);
  padding-bottom: var(--space-12);
}

/* Two Column Layout (Content + Sidebar) */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr 320px;
  }
}

.content-area {
  min-width: 0; /* Prevent grid blowout */
}

.sidebar {
  position: sticky;
  top: var(--space-6);
  align-self: start;
}

/* ===================================
   Typography
   =================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.875rem);
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: var(--space-4);
}

.text-muted {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.5;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ===================================
   Cards
   =================================== */

.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--gray-200);
}

.card-body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--gray-900);
  line-height: 1.3;
}

.card-text {
  color: var(--gray-600);
  margin-bottom: var(--space-4);
  flex: 1;
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* ===================================
   Grid System
   =================================== */

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-1 {
  grid-template-columns: 1fr;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (min-width: 640px) {
  .sm\:grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .md\:grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .md\:grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .lg\:grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .lg\:grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===================================
   Buttons
   =================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  gap: var(--space-2);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-300);
  color: var(--gray-900);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.8125rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}

/* ===================================
   Hero Section
   =================================== */

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: var(--space-12) 0;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-10);
}

.hero-content {
  max-width: 800px;
  padding: 0 var(--space-6);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: var(--space-4);
  color: white;
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.25rem);
  opacity: 0.95;
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ===================================
   Section Headers
   =================================== */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--gray-200);
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.section-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-link:hover {
  gap: var(--space-3);
}

/* ===================================
   Sidebar Widgets
   =================================== */

.widget {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-6);
}

.widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--gray-200);
}

.widget-list {
  list-style: none;
}

.widget-item {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--gray-100);
}

.widget-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.widget-item-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: var(--space-2);
  line-height: 1.4;
  display: block;
  transition: color 0.2s;
}

.widget-item-title:hover {
  color: var(--primary);
}

.widget-item-meta {
  font-size: 0.8125rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Widget with thumbnail */
.widget-item-thumb {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.widget-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--gray-200);
}

.widget-item-content {
  flex: 1;
  min-width: 0;
}

/* ===================================
   Search Bar
   =================================== */

.search-box {
  position: relative;
  margin-bottom: var(--space-6);
}

.search-input {
  width: 100%;
  padding: var(--space-4) var(--space-12) var(--space-4) var(--space-4);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-btn {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
}

/* Keep the search button vertically centered even when global button hover
   rules apply transform: the global .btn-primary:hover sets a transform which
   can override the centering and cause the button (and the visual search bar)
   to shift. Force the centering transform for the search button and allow
   only non-position hover effects like box-shadow. */
.search-btn {
  transition: box-shadow 0.18s ease, background-color 0.18s ease;
}

.search-btn:hover,
.search-btn:active,
.search-btn:focus {
  /* Re-apply centering transform (important to override .btn-primary:hover)
     and allow a subtle shadow on hover without shifting position. */
  transform: translateY(-50%) !important;
  box-shadow: var(--shadow-md);
}

/* ===================================
   Badges & Tags
   =================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fed7aa;
  color: #92400e;
}

/* ===================================
   Rating Stars
   =================================== */

.rating {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--accent);
  font-size: 1rem;
}

.rating-text {
  margin-left: var(--space-2);
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ===================================
   Article Content
   =================================== */

.article-header {
  margin-bottom: var(--space-8);
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  color: var(--gray-600);
  font-size: 0.875rem;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.article-content {
  background: white;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--gray-700);
}

.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: var(--font-sans);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.article-content p {
  margin-bottom: var(--space-5);
}

.article-content img {
  border-radius: var(--radius-md);
  margin: var(--space-6) 0;
}

.article-content ul,
.article-content ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-8);
}

.article-content li {
  margin-bottom: var(--space-3);
}

/* ===================================
   Breadcrumbs
   =================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  font-size: 0.875rem;
  color: var(--gray-600);
}

.breadcrumb-separator {
  color: var(--gray-400);
}

/* ===================================
   Empty States
   =================================== */

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--gray-500);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: 0.9375rem;
}

/* ===================================
   Utilities
   =================================== */

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ===================================
   Responsive Utilities
   =================================== */

@media (max-width: 639px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 640px) {
  .show-mobile {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .hide-tablet {
    display: none !important;
  }
}

/* ===================================
   Print Styles
   =================================== */

@media print {
  .sidebar,
  .hero-actions,
  .btn,
  .search-box {
    display: none;
  }
  
  .article-content {
    box-shadow: none;
  }
}

/* ===================================
   Mobile Drawer - Modern Professional Design
   Redesigned mobile navigation with glassmorphism and smooth animations
   =================================== */
.mobile-nav{
  display:block;
  position:fixed;
  left:0;
  top:0;
  height:100vh;
  width:280px;
  max-width: 85vw;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 4px 0 24px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.04);
  transform: translateX(-110%);
  transition: transform .32s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2147483647;
  overflow-y:auto;
  overflow-x:hidden;
}
.mobile-nav.open{
  transform: translateX(0);
  animation: slideInLeft 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInLeft {
  from {
    transform: translateX(-110%);
    opacity: 0.8;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Backdrop overlay with enhanced blur */
.mobile-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: all .28s ease;
  z-index: 2147483646;
}
.mobile-backdrop.open{
  opacity: 1;
  pointer-events: auto;
}

/* hide the mobile drawer in wider screens */
@media (min-width: 768px){
  .mobile-nav, .mobile-backdrop { display: none !important; }
}

/* ===================================
   Mobile Drawer Header - Glassmorphism Design
   =================================== */
.mobile-nav-header{
  position: relative;
  padding: 20px 20px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-nav-brand{
  display:flex;
  align-items:center;
  gap:14px;
}
.mobile-nav-logo{
  width:42px;
  height:42px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 2px solid rgba(255,255,255,0.2);
}
.mobile-nav-logo.fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  color: #667eea;
  background: rgba(255,255,255,0.95);
}
.mobile-nav-company{
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.mobile-nav-close{
  position:absolute;
  right:16px;
  top:16px;
  border:none;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  color:#fff;
  padding:8px;
  border-radius:10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mobile-nav-close:hover{
  background: rgba(255,255,255,0.25);
  transform: rotate(90deg);
}

/* ===================================
   Mobile Navigation List - Modern Cards
   =================================== */
.mobile-nav-list{
  list-style:none;
  margin: 0;
  padding: 16px 12px;
}
.mobile-nav-list li{
  margin-bottom: 4px;
}
.mobile-nav-list li a{
  display:none; /* hide old plain links */
}
.mobile-nav-link{
  display:flex !important;
  align-items:center;
  gap:14px;
  padding: 14px 16px;
  color: #2d3748;
  font-weight:600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 12px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.04);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.mobile-nav-link::before{
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: scaleY(0);
  transition: transform 0.22s ease;
}
.mobile-nav-link:hover,
.mobile-nav-link:active{
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
  transform: translateX(4px);
  border-color: rgba(102, 126, 234, 0.2);
}
.mobile-nav-link:hover::before{
  transform: scaleY(1);
}
.mobile-nav-link:active{
  transform: translateX(2px) scale(0.98);
}

.mobile-nav-link-highlight{
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border-color: rgba(102, 126, 234, 0.2);
}
.mobile-nav-link-highlight:hover{
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.mobile-nav-icon{
  width:20px;
  height:20px;
  flex-shrink: 0;
  color: #667eea;
  transition: all 0.2s ease;
}
.mobile-nav-link:hover .mobile-nav-icon{
  color: #764ba2;
  transform: scale(1.1);
}
.mobile-nav-text{
  flex: 1;
  font-weight: 600;
}
.mobile-nav-arrow{
  width:16px;
  height:16px;
  color: #a0aec0;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.22s ease;
}
.mobile-nav-link:hover .mobile-nav-arrow{
  opacity: 1;
  transform: translateX(0);
}

.mobile-nav-divider{
  height:1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.08) 50%, transparent 100%);
  margin: 12px 16px;
}

/* ===================================
   Mobile Navigation Footer - Modern Badge
   =================================== */
.mobile-nav-footer{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(248,249,250,0) 0%, rgba(248,249,250,0.95) 20%, rgba(248,249,250,1) 100%);
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-nav-footer-text{
  font-size: 0.8rem;
  color: #718096;
  font-weight: 500;
}
.mobile-nav-footer-badge{
  font-size: 0.7rem;
  padding: 4px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
} 
