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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
header {
  background: white;
  padding: 20px 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 24px;
  color: #0070f3;
  font-weight: 600;
}

header p {
  color: #666;
  font-size: 14px;
  margin-top: 5px;
}

nav {
  display: flex;
  gap: 15px;
}

nav a {
  padding: 8px 16px;
  background: #0070f3;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.2s;
}

nav a:hover {
  background: #0051cc;
}

nav a.active {
  background: #0051cc;
  font-weight: 600;
}

/* Footer Styles */
footer {
  background: white;
  padding: 30px 0;
  margin-top: 50px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

footer p {
  color: #666;
  font-size: 14px;
}

footer a {
  color: #0070f3;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Main Content */
main {
  min-height: calc(100vh - 200px);
}

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

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* Loading and Error States */
.loading, .error {
  padding: 20px;
  margin: 20px 0;
  border-radius: 4px;
  text-align: center;
}

.loading {
  background: #e3f2fd;
  color: #1976d2;
}

.error {
  background: #ffebee;
  color: #c62828;
}

/* Buttons */
button {
  padding: 8px 16px;
  background: #0070f3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

button:hover {
  background: #0051cc;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Forms */
select, input[type="text"], input[type="number"] {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

select:focus, input:focus {
  outline: none;
  border-color: #0070f3;
}

label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* Articles List Styles */
.articles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-card {
  background: white;
  border-radius: 4px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 3px solid #0070f3;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  position: relative;
}

.article-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Three-dot menu */
.menu-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  border-radius: 4px;
}

.menu-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.context-menu {
  display: none;
  position: absolute;
  left: 10px;
  top: 45px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1000;
  min-width: 120px;
}

.context-menu.show {
  display: block;
}

.context-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.context-menu button:hover {
  background: #f0f0f0;
}

.context-menu button.danger {
  color: #ef4444;
}

.context-menu button.danger:hover {
  background: #fef2f2;
}

/* Article checkbox */
.article-checkbox {
  margin: 0;
  cursor: pointer;
}

/* Article title with inline editing */
.article-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-title a {
  color: #0070f3;
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-title a:hover { 
  text-decoration: underline;
}

.article-title.editing a {
  display: none;
}

.edit-input {
  display: none;
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #0070f3;
  border-radius: 3px;
  font-size: 14px;
}

.article-title.editing .edit-input {
  display: block;
}

.save-btn, .cancel-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 3px;
}

.save-btn { 
  color: #10b981; 
}

.save-btn:hover { 
  background: #ecfdf5; 
}

.cancel-btn { 
  color: #ef4444; 
}

.cancel-btn:hover { 
  background: #fef2f2; 
}

.save-btn, .cancel-btn { 
  display: none; 
}

.article-title.editing .save-btn,
.article-title.editing .cancel-btn { 
  display: inline-block; 
}

.edited-indicator {
  font-size: 10px;
  color: #10b981;
  font-weight: 600;
}

/* Article metadata */
.article-date {
  color: #666;
  font-size: 13px;
  white-space: nowrap;
  min-width: 90px;
}

.article-source {
  display: inline-block;
  padding: 3px 8px;
  background: #f0f0f0;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 70px;
  text-align: center;
}

.article-places {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 150px;
}

.place-tag {
  display: inline-block;
  padding: 3px 8px;
  background: #0070f3;
  color: white;
  border-radius: 10px;
  font-size: 11px;
  white-space: nowrap;
}

/* Filters */
.filters {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filters select, .filters button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.filters button {
  background: #0070f3;
  color: white;
  cursor: pointer;
  border: none;
}

.filters button:hover { 
  background: #0051cc; 
}

/* Pagination */
.pagination {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: blue;
  cursor: pointer;
  font-size: 14px;
}

.pagination button:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #0070f3;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background: #0070f3;
  color: white;
  border-color: #0070f3;
}

.pagination .page-info {
  padding: 0 10px;
  font-size: 14px;
  color: #666;
}

/* Floating Action Menu */
.floating-action-menu {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 12px 20px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  border: 1px solid #e0e0e0;
}

.floating-action-menu.show {
  display: flex;
}

.floating-action-menu button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: #10b981;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.floating-action-menu button:hover {
  background: #059669;
}

.floating-action-menu button.secondary {
  background: #6b7280;
}

.floating-action-menu button.secondary:hover {
  background: #4b5563;
}

.floating-action-menu .count {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.floating-action-menu .message {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.floating-action-menu .default-view,
.floating-action-menu .confirm-view,
.floating-action-menu .success-view {
  display: none;
  align-items: center;
  gap: 12px;
}

.floating-action-menu.show .default-view {
  display: flex;
}

.floating-action-menu.confirming .default-view {
  display: none;
}

.floating-action-menu.confirming .confirm-view {
  display: flex;
}

.floating-action-menu.success .success-view {
  display: flex;
}

.floating-action-menu.success .default-view,
.floating-action-menu.success .confirm-view {
  display: none;
}
