@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:ital,wght@0,300..900;1,300..900&display=swap');

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

body {
  font-family: 'Red Hat Display', sans-serif;
  font-optical-sizing: auto;
  background-color: #f4f4f4;
  color: #111827;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Red Hat Display', sans-serif;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
}

p {
  margin-bottom: 1rem;
}

/* Navigation */
.topnav {
  background-image: linear-gradient(to right, #ce2424, #ec1818);
  overflow: hidden;
  padding: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav a {
  float: left;
  color: #000000;
  text-align: left;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  transition: background-color 0.3s ease;
}

.topnav a:hover {
  background-color: #ec1818;
  color: black;
}

.topnav a.split {
  float: right;
  color: #000000;
}

.topnav img {
  height: 40px;
  vertical-align: middle;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

main {
  padding: 0;
}

/* Forms */
.form-container {
  max-width: 400px;
  margin: 40px auto;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
  text-align: left;
  margin-bottom: 1.5rem;
}

.form-container .form-group {
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

input[type='text'],
input[type='email'],
input[type='password'],
textarea,
select {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Red Hat Display', sans-serif;
  font-size: 1rem;
}

input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #ce2424;
  box-shadow: 0 0 0 3px rgba(206, 36, 36, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: left;
  font-family: 'Red Hat Display', sans-serif;
  margin-top: 5px;
}

.btn-primary {
  background-color: #ce2424;
  color: white;
}

.btn-primary:hover {
  background-color: #ec1818;
}

.btn-secondary {
  background-color: #d1d5db;
  color: #111827;
}

.btn-secondary:hover {
  background-color: #9ca3af;
}

.btn-success {
  background-color: #10b981;
  color: white;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}

.btn-danger:hover {
  background-color: #ec1818;
}

.btn-warning {
  background-color: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background-color: #d97706;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
  margin-right: 5px;
}

/* Form Switch */
.form-switch {
  text-align: left;
  margin-top: 20px;
}

.form-switch a {
  color: #ce2424;
  text-decoration: none;
}

.form-switch a:hover {
  text-decoration: underline;
}

#login-error,
#register-error,
#post-error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  display: none;
}

/* Post Feed */
.post-feed {
  margin: 20px 0;
}

.post-item {
  margin: 20px 0;
  padding: 10px;
  border-bottom: 1px solid #ccc;
}

.post-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #111827;
}

.post-body {
  color: #4b5563;
  margin-bottom: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.post-image {
  width: 80%;
  max-width: 800px;
  height: auto;
  display: block;
  margin: 10px auto;
  border-radius: 6px;
}

.post-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.post-actions .btn {
  margin-top: 0;
}

/* Comments */
.comment-box {
  margin-top: 10px;
  padding-left: 20px;
}

.comment-box h5 {
  margin: 10px 0 5px 0;
  font-weight: 600;
}

.comment {
  margin-bottom: 10px;
  border-left: 2px solid #ccc;
  padding-left: 10px;
}

.comment p {
  margin: 5px 0;
  white-space: pre-wrap;
}

.comment small {
  display: block;
  margin-top: 5px;
  color: #6b7280;
}

.comment form {
  display: inline;
  margin-left: 10px;
}

.comment-form {
  margin-top: 10px;
}

.comment-form textarea {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Card Styles */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* Admin Panel */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  text-align: left;
}

.admin-card-value {
  font-size: 2rem;
  font-weight: bold;
  color: #ce2424;
  margin-bottom: 0.5rem;
}

.admin-card-label {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

thead {
  background-color: #f9fafb;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
}

td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

tbody tr:hover {
  background-color: #f9fafb;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-badge.active {
  background-color: #d1fae5;
  color: #065f46;
}

.status-badge.inactive {
  background-color: #fee2e2;
  color: #7f1d1d;
}

.role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  background-color: #dbeafe;
  color: #082f49;
}

.role-badge.owner {
  background-color: #fef3c7;
  color: #78350f;
}

.role-badge.admin {
  background-color: #e9d5ff;
  color: #6b21a8;
}

/* Footer */
footer {
  color: #000000;
  text-align: left;
  margin-top: 2rem;
  padding: 2rem 1rem;
  border-top: 1px solid #ccc;
}

footer p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

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

.text-muted {
  color: #6b7280;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0.5rem;
  }

  .form-container {
    margin: 20px 10px;
  }

  .post-image {
    width: 100%;
  }

  .btn-sm {
    display: block;
    width: 100%;
    margin-bottom: 5px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .topnav a {
    padding: 10px 12px;
    font-size: 14px;
  }

  .form-container {
    margin: 10px;
    padding: 15px;
  }

  h3 {
    font-size: 1.2rem;
  }

  .post-title {
    font-size: 1.1rem;
  }

  .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}
