/* ===================================
   MODERN PROFESSIONAL DESIGN
   Les Internets - News Website
   =================================== */

/* CSS Variables for Consistent Theming */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   GLOBAL STYLES
   =================================== */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===================================
   HEADER / NAVIGATION
   =================================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.hamburger {
  font-size: 28px;
  cursor: pointer;
  color: var(--text-primary);
  padding: 8px 12px;
  margin-right: 16px;
  border-radius: 8px;
  transition: var(--transition);
  user-select: none;
}

.hamburger:hover {
  background-color: var(--background);
  color: var(--primary-color);
}

.hamburger:active {
  transform: scale(0.95);
}

/* ===================================
   SEARCH BAR
   =================================== */

.search-container {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.search-container form {
  display: flex;
  width: 100%;
  gap: 12px;
}

.search-container input[type="text"] {
  flex: 1;
  padding: 12px 20px;
  font-size: 15px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background-color: var(--background);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

.search-container input[type="text"]:focus {
  border-color: var(--primary-color);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-container input[type="text"]::placeholder {
  color: var(--text-secondary);
}

.search-container button {
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.search-container button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.search-container button:active {
  transform: translateY(0);
}

/* ===================================
   SIDEBAR NAVIGATION
   =================================== */

.sidebar {
  position: fixed;
  top: 70px;
  left: 0;
  width: 260px;
  height: calc(100vh - 70px);
  background-color: var(--surface);
  border-right: 1px solid var(--border-color);
  padding: 24px 0;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

.sidebar ul {
  list-style-type: none;
}

.sidebar ul li {
  margin: 4px 12px;
}

.sidebar ul li a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  transition: var(--transition);
}

.sidebar ul li a:hover {
  background-color: var(--background);
  color: var(--primary-color);
  padding-left: 20px;
}

.sidebar ul li a:active {
  transform: scale(0.98);
}

/* Separator styling - more subtle */
.sidebar hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-color), transparent);
  margin: 16px 20px;
}

/* ===================================
   MAIN CONTENT AREA
   =================================== */

.main-content {
  margin-left: 260px;
  margin-top: 70px;
  padding: 32px 24px;
  flex-grow: 1;
  min-height: calc(100vh - 70px);
}

/* ===================================
   ARTICLE GRID / HOMEPAGE
   =================================== */

.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 0 auto;
  max-width: 1400px;
}

.article-card {
  background-color: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

.article-card:hover .thumbnail {
  transform: scale(1.05);
}

.title {
  padding: 16px 16px 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.title a:hover {
  color: var(--primary-color);
}

.meta {
  padding: 0 16px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===================================
   ARTICLE DETAIL PAGE
   =================================== */

.article-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--surface);
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.article-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.article-abstract {
  font-size: 18px;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
  padding-left: 20px;
  border-left: 4px solid var(--primary-color);
}

.article-meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.article-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.article-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 20px;
}

.article-content h1,
.article-content h2,
.article-content h3 {
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.article-content h1 { font-size: 32px; }
.article-content h2 { font-size: 28px; }
.article-content h3 { font-size: 24px; }

.article-content a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.article-content a:hover {
  border-bottom-color: var(--primary-color);
}

.article-content code {
  background-color: var(--background);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.article-content pre {
  background-color: var(--background);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.article-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 20px;
  margin: 20px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-content ul,
.article-content ol {
  margin-left: 24px;
  margin-bottom: 20px;
}

.article-content li {
  margin-bottom: 8px;
}

/* ===================================
   KEYWORDS / TAGS
   =================================== */

.article-keywords {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.article-keywords a {
  text-decoration: none;
  color: inherit;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.keyword-tag {
  background-color: var(--background);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
}

.keyword-tag:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ===================================
   BREADCRUMBS
   =================================== */

nav[aria-label="breadcrumb"] {
  padding: 20px 0;
  font-size: 14px;
}

nav[aria-label="breadcrumb"] ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

nav[aria-label="breadcrumb"] a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

nav[aria-label="breadcrumb"] a:hover {
  text-decoration: underline;
}

nav[aria-label="breadcrumb"] li:not(:first-child)::before {
  content: '/';
  margin-right: 8px;
  color: var(--text-secondary);
}

/* ===================================
   PAGE TITLES
   =================================== */

h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablet */
@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
    padding: 24px 16px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .container {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }

  .article-container {
    padding: 32px 24px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  header {
    padding: 0 16px;
    height: 60px;
  }

  .main-content {
    margin-top: 60px;
    padding: 20px 12px;
  }

  .sidebar {
    top: 60px;
    height: calc(100vh - 60px);
    width: 280px;
  }

  .search-container {
    max-width: 100%;
  }

  .search-container form {
    gap: 8px;
  }

  .search-container input[type="text"] {
    font-size: 14px;
    padding: 10px 16px;
  }

  .search-container button {
    padding: 10px 16px;
    font-size: 14px;
  }

  .container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .article-container {
    padding: 24px 16px;
    border-radius: 0;
    box-shadow: none;
  }

  .article-title {
    font-size: 28px;
  }

  .article-abstract {
    font-size: 16px;
  }

  .article-content {
    font-size: 16px;
  }

  h1 {
    font-size: 26px;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .search-container input[type="text"] {
    font-size: 13px;
    padding: 8px 12px;
  }

  .search-container button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .article-title {
    font-size: 24px;
  }

  .thumbnail {
    height: 180px;
  }
}

/* ===================================
   SIDEBAR TOGGLE (for mobile)
   =================================== */

.sidebar.open {
  transform: translateX(0) !important;
}

/* Overlay for mobile when sidebar is open */
@media (max-width: 1024px) {
  .sidebar.open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 32px;
}

.mb-4 {
  margin-bottom: 32px;
}

/* ===================================
   LOADING STATES & ANIMATIONS
   =================================== */

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

.article-card {
  animation: fadeIn 0.5s ease-out;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
  header,
  .sidebar,
  .search-container,
  .article-keywords {
    display: none;
  }

  .main-content {
    margin: 0;
    padding: 0;
  }

  .article-container {
    box-shadow: none;
    border: none;
  }
}
