/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

/* Layout */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  min-height: calc(100vh - 160px);
  padding: 40px 0;
}

/* Navigation */
.navbar {
  background-color: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0;
}

.nav-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  color: #333;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

.nav-menu a {
  text-decoration: none;
  color: #666;
  font-weight: 500;
}

.nav-menu a:hover {
  color: #333;
}

.nav-dropdown {
  position: relative;
}

.nav-user {
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  list-style: none;
  min-width: 120px;
  z-index: 1000;
}

.nav-dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content li {
  padding: 0;
}

.dropdown-content a {
  display: block;
  padding: 10px 15px;
  color: #666;
  text-decoration: none;
}

.dropdown-content a:hover {
  background-color: #f5f5f5;
  color: #333;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #f5f5f5;
  color: #333;
  text-decoration: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  background-color: #e5e5e5;
  text-decoration: none;
}

.btn-primary {
  background-color: #0066cc;
  color: #fff;
  border-color: #0066cc;
}

.btn-primary:hover {
  background-color: #0052a3;
  border-color: #0052a3;
}

.btn-secondary {
  background-color: #6c757d;
  color: #fff;
  border-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #545b62;
  border-color: #545b62;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
.search-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

input:focus,
.search-input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

button[type="submit"] {
  background-color: #0066cc;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

button[type="submit"]:hover {
  background-color: #0052a3;
}

/* Login Page */
.login-container {
  max-width: 400px;
  margin: 80px auto;
  padding: 40px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background-color: #fff;
}

.login-container h1 {
  text-align: center;
  margin-bottom: 30px;
}

.error {
  background-color: #fee;
  color: #c33;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  border: 1px solid #fcc;
}

/* Home Page */
.hero {
  text-align: center;
  padding: 0;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 40px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  min-height: 37.5vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  width: 100%;
  overflow: hidden;
}

.hero-overlay {
  background: rgba(0, 0, 0, 0.3);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
}

.hero-content {
  padding: 60px 20px;
  max-width: 700px;
  margin: 0 auto;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.25rem;
  color: white;
}

.home-actions {
  text-align: center;
  margin-top: 40px;
}

/* Articles */
.articles-grid,
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.article-card {
  padding: 30px 0;
  border-bottom: 1px solid #e5e5e5;
}

.article-card:last-child {
  border-bottom: none;
}

.article-card h3 {
  margin-bottom: 10px;
}

.article-card h3 a {
  color: #333;
  text-decoration: none;
}

.article-card h3 a:hover {
  color: #0066cc;
}

.article-meta {
  color: #666;
  font-size: 14px;
  margin-bottom: 15px;
}

.article-tags {
  margin-top: 10px;
}

.tag {
  display: inline-block;
  background-color: #f5f5f5;
  color: #666;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  text-decoration: none;
  margin-right: 5px;
}

.tag:hover {
  background-color: #e5e5e5;
  text-decoration: none;
}

.read-more {
  color: #0066cc;
  font-weight: 500;
  margin-left: 10px;
}

/* Full Article */
.article-full {
  max-width: 100%;
}

.article-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

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

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content blockquote {
  border-left: 4px solid #0066cc;
  padding-left: 20px;
  margin: 20px 0;
  color: #666;
  font-style: italic;
}

.article-content code {
  background-color: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
}

.article-content pre {
  background-color: #f5f5f5;
  padding: 20px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 20px 0;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* Search */
.page-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.search-box {
  margin-top: 20px;
}

.search-box form {
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
}

.no-results {
  text-align: center;
  padding: 60px 0;
  color: #666;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
}

.pagination-link {
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
}

.pagination-link:hover {
  text-decoration: underline;
}

.pagination-info {
  color: #666;
  font-size: 14px;
}

/* Admin Dashboard */
.admin-dashboard {
  padding: 20px 0;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background-color: #f8f9fa;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e5e5e5;
}

.stat-card h3 {
  font-size: 2.5rem;
  color: #0066cc;
  margin-bottom: 10px;
}

.stat-card p {
  color: #666;
  margin-bottom: 0;
  font-weight: 500;
}

.dashboard-actions {
  margin-bottom: 40px;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.admin-articles-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-article-item {
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.admin-article-item h4 {
  margin-bottom: 10px;
}

.admin-article-item .article-meta {
  display: flex;
  gap: 15px;
  align-items: center;
}

.status-published {
  color: #28a745;
  font-weight: 500;
}

.status-draft {
  color: #ffc107;
  font-weight: 500;
}

/* Admin Tables */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #e5e5e5;
}

.admin-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover {
  background-color: #f8f9fa;
}

/* Error Pages */
.error-page {
  text-align: center;
  padding: 80px 0;
}

.error-code {
  font-size: 6rem;
  color: #ddd;
  margin-bottom: 20px;
}

.error-message {
  color: #666;
  margin-bottom: 10px;
}

.error-description {
  color: #999;
  margin-bottom: 30px;
}

/* Footer */
footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e5e5e5;
  padding: 30px 0;
  text-align: center;
}

.footer-text {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* Large screens */
@media (min-width: 1200px) {
  .hero {
    min-height: 42.5vh;
  }
  
  .hero-content {
    padding: 80px 20px;
  }
  
  .hero h1 {
    font-size: 3.5rem;
  }
  
  .hero p {
    font-size: 1.5rem;
    color: white;
  }
}

/* Responsive Design */
@media (max-width: 1024px) and (min-width: 769px) {
  .hero {
    min-height: 32.5vh;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
    color: white;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .nav-container {
    padding: 0 15px;
  }
  
  .nav-menu {
    gap: 15px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
    color: white;
  }
  
  .hero {
    min-height: 27.5vh;
  }
  
  .hero-content {
    padding: 0 15px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
    color: white;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .admin-header {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
  
  .admin-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .search-box form {
    flex-direction: column;
  }
  
  .pagination {
    flex-direction: column;
    gap: 15px;
  }
}