@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
  --primary: #2563EB; /* Blue */
  --primary-hover: #1D4ED8;
  --secondary: #10B981; /* Emerald */
  --bg-color: #f9fafb;
  --surface: #ffffff;
  --surface-border: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --error: #ef4444;
  --success: #10B981;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
}

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Layouts */
.container {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.main-content {
  background: var(--surface);
  padding: 2rem;
  width: 100%;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.title {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  text-align: center;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.button-group {
  display: flex; 
  gap: 10px;
}

label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

input[type="text"],
input[type="file"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

option {
  background: #ffffff;
  color: var(--text-main);
}

/* Buttons */
button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

button:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Previews & Utilities */
.status-text {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--secondary);
}

.image-preview {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f3f4f6;
  border-radius: 8px;
  border: 1px dashed var(--surface-border);
}

.preview-img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

.message.success {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.message.error {
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
}

/* Admin Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--surface-border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.admin-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--primary);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 600;
}

.nav-link:hover {
  background: var(--bg-color);
  color: var(--text-main);
}

.admin-main {
  flex: 1;
  padding: 3rem;
  overflow-y: auto;
}

/* Grievance Grid */
.grievance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.grievance-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grievance-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--surface-border);
}

.category-badge {
  background: #eff6ff;
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.pending {
  background: #fffbeb;
  color: #d97706;
}

.status-badge.solved {
  background: #ecfdf5;
  color: var(--success);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-color);
}

.card-body {
  padding: 1.5rem;
}

.card-body .desc {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.card-body .gps, .card-body .date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-color);
  border-top: 1px solid var(--surface-border);
  text-align: center;
}

.solve-btn {
  background: var(--secondary);
  padding: 0.75rem;
}

.solve-btn:hover {
  background: #059669;
}

.solved-text {
  color: var(--success);
  font-weight: 600;
}

/* Category Management */
.category-form {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
  max-width: 500px;
}

.category-form button {
  width: auto;
  white-space: nowrap;
}

.category-list ul {
  list-style: none;
  margin-top: 1rem;
}

.category-list li {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  max-width: 500px;
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0;
  }
  
  .main-content {
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
    padding: 1.5rem;
    box-shadow: none;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .admin-layout {
    flex-direction: column;
  }
  
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--surface-border);
    padding: 1.5rem;
  }
  
  .admin-main {
    padding: 1.5rem;
  }

  .title {
    font-size: 1.75rem;
  }
  
  .category-form {
    flex-direction: column;
  }
  
  .category-form button {
    width: 100%;
  }
}
