:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #ffffff;
  --bg-light: #f8fafc;
  --text: #1f2937;
  --text-light: #64748b;
  --border: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 12px;
}

* { box-sizing: border-box; }
body { 
  margin: 0; 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
  color: var(--text); 
  background: var(--bg-light); 
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

/* Header / layout */
.header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 16px 20px; 
  background: var(--bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header .brand { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}
.header .brand img { 
  height: 40px; 
  width: 40px;
  object-fit: contain;
}
.header .brand h1 { 
  font-size: 1.5rem; 
  margin: 0; 
  color: var(--primary); 
  font-weight: 700; 
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
}

.nav-menu {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-menu a {
  font-weight: 600;
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.nav-menu a:hover {
  background: var(--bg-light);
  color: var(--primary);
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed;
    top: 72px;
    left: -100%;
    width: 250px;
    height: calc(100vh - 72px);
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    transition: left 0.3s;
    z-index: 99;
  }
  .nav-menu.active { left: 0; }
  .nav-menu a {
    width: 100%;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }
}

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

.grid { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 24px; 
}
@media (min-width: 968px) { 
  .grid { grid-template-columns: 2fr 1fr; } 
}

/* Cards (posts) */
.card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 24px;
  position: relative;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card img { 
  width: 100%; 
  height: 200px; 
  object-fit: cover; 
  background: var(--bg-light); 
}
@media (min-width: 768px) { 
  .card img { height: 240px; } 
}

.card .content { 
  padding: 20px; 
  padding-bottom: 70px; /* Space for floating buttons */
}
.card h3 { 
  margin: 0 0 12px; 
  font-size: 1.25rem; 
  color: var(--text); 
  line-height: 1.4;
  font-weight: 600;
}
.card ul { 
  margin: 0 0 16px; 
  padding-left: 20px; 
}
.card ul li { 
  margin: 8px 0; 
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Post type indicator */
.post-type {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.post-type.ad { background: #ef4444; }
.post-type.blog { background: #8b5cf6; }

/* Sidebar */
.sidebar .widget { 
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.sidebar .widget .content {
  padding: 20px;
}
.sidebar h3 { 
  margin: 0 0 12px; 
  color: var(--text); 
  font-size: 1.1rem;
}

/* Footer */
.footer { 
  background: var(--bg);
  text-align: center; 
  padding: 32px 20px; 
  color: var(--text-light); 
  border-top: 1px solid var(--border); 
  margin-top: 40px; 
}
.footer a {
  color: var(--text-light);
  margin: 0 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
/* Add this after your existing .btn styles */
.btn.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Make floating action buttons smaller */
.floating-actions .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Optional: Make them even smaller on mobile */
@media (max-width: 768px) {
    .floating-actions .btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}
.btn:hover { 
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--accent); }
.btn.secondary:hover { background: var(--accent-dark); }
.btn.btn--green { background: #22c55e; }
.btn.btn--green:hover { background: #16a34a; }
.btn.danger { background: #ef4444; }
.btn.danger:hover { background: #dc2626; }

/* Floating action buttons */
.floating-actions {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

/* Tables & Forms (Admin) */
.admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  background: var(--bg-light);
  min-height: 100vh;
}

.admin-header {
  background: var(--bg);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-nav {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-nav a {
  padding: 12px 20px;
  background: var(--bg);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}
.admin-nav a:hover, .admin-nav a.active {
  background: var(--primary);
  color: white;
}

.admin-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-card h2 {
  margin: 0 0 20px;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
}

.table { 
  width: 100%; 
  border-collapse: collapse;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table th, .table td { 
  padding: 12px 16px; 
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th { 
  background: var(--bg-light); 
  font-weight: 600;
  color: var(--text);
}

.form-group { 
  margin: 16px 0; 
}
.form-group label { 
  display: block;
  font-weight: 600; 
  color: var(--text);
  margin-bottom: 6px;
}

input[type=text], input[type=url], input[type=password], input[type=email], select, textarea { 
  width: 100%; 
  padding: 12px 16px; 
  border: 2px solid var(--border); 
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
  background: var(--bg);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Rich Text Editor */
.editor-container {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.editor-toolbar {
  background: var(--bg-light);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.editor-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.editor-btn:hover {
  background: var(--primary);
  color: white;
}
.editor-content {
  min-height: 200px;
  padding: 12px;
  background: var(--bg);
}

/* Image upload */
.image-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-light);
  transition: border-color 0.2s;
  cursor: pointer;
}
.image-upload:hover {
  border-color: var(--primary);
}
.image-upload.dragover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 16px 0;
  font-weight: 500;
}
.alert.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.alert.danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.alert.warning {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fde68a;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .container { padding: 16px; }
  .card .content { padding: 16px; padding-bottom: 60px; }
  .floating-actions { bottom: 12px; right: 12px; }
  .admin-container { padding: 12px; }
  .admin-card { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

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

/* Notice/Intro section */
.intro-section {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 32px;
  text-align: center;
}

.intro-section h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-weight: 600;
}

.intro-section p {
  margin: 0;
  opacity: 0.9;
}
