:root {
  --bg: #f6f8fa;
  --panel: #ffffff;
  --panel-light: #f3f4f6;
  --text: #1f2937;
  --text-bright: #111827;
  --accent: #238636;
  --accent-hover: #2ea043;
  --danger: #da3633;
  --muted: #6b7280;
  --border: #d1d5db;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Typography */
h1, h2, h3 {
  color: var(--text-bright);
  font-weight: 600;
}

/* Layout */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.app-header .logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.app-header .logo-container img {
  height: 32px;
  width: auto;
  border-radius: 6px;
}

.app-header .logo-container::before {
  content: "T";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-weight: 800;
  font-size: 20px;
}

.app-header .logo-container img:not([style*="display: none"]) + h1,
.app-header .logo-container img + h1 {
  margin-left: 0;
}

/* If image is present, hide the ::before */
.app-header .logo-container:has(img:not([style*="display: none"]))::before {
  display: none;
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.5px;
}

.app-header h1 span {
  color: var(--accent);
}

.welcome-panel h2 {
  margin-top: 0;
  font-size: 24px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.welcome-panel h2::before {
  content: "👋";
}

.app-header nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.app-header a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.install-button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.install-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.install-button::before {
  content: "↓"; /* Download icon */
  font-weight: bold;
}

/* Layouts */
.app-main {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

.admin-layout {
  display: grid;
  grid-template-columns: 450px 1fr; /* Form solda, harita sağda */
  gap: 24px;
  padding: 24px;
  max-width: 100%;
  align-items: start;
}

/* Mobile Responsive */
@media (max-width: 1100px) {
  .app-main, .admin-layout {
    grid-template-columns: 1fr;
  }
  
  .admin-layout {
    display: flex;
    flex-direction: column-reverse; /* Mobilde harita üstte form altta olsun istenirse */
  }
}

/* Campaign Cards in User List */
.campaign-card {
  background: white;
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.campaign-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
  border-color: var(--accent-hover);
}

.campaign-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 12px;
  display: block;
}

.campaign-card .msg-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
}

.campaign-card .click-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  text-align: right;
}

/* Admin Specific */
.admin-form-panel {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.admin-map-panel {
  position: sticky;
  top: 80px;
  height: calc(100vh - 100px);
}

.admin-map-panel .map {
  height: 100% !important;
}

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-panel {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border-left: 5px solid var(--accent);
}

.welcome-panel h2 {
  margin-top: 0;
  font-size: 24px;
  color: var(--accent);
}

#campaign-panel {
  background: #ffffff;
  border: 2px solid var(--accent);
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

#campaign-panel h2 {
  margin-top: 0;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

/* Map */
.map {
  height: 450px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Form Elements */
.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--muted);
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-bright);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 134, 54, 0.3);
}

button {
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--panel-light);
  color: var(--text-bright);
}

button:hover {
  background: #30363d;
  border-color: #8b949e;
}

button.save, button#login-btn {
  background: var(--accent);
  color: white;
  border: none;
}

button.save:hover, button#login-btn:hover {
  background: var(--accent-hover);
}

button.save.edit-mode {
  background: #f59e0b; /* Orange for edit */
}

button.save.edit-mode:hover {
  background: #d97706;
}

button.delete {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

button.delete:hover {
  background: var(--danger);
  color: white;
}

/* Status & Messages */
.status {
  padding: 12px 16px;
  background: var(--panel-light);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.message {
  padding: 0;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-bright);
}

.active-badge {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.active-badge span {
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(35, 134, 54, 0.3);
  animation: pulse 2s infinite;
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* List Items */
.list {
  max-height: 500px;
  overflow-y: auto;
}

.list-item {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 0.2s;
}

.list-item:hover {
  transform: translateX(4px);
}

.list-item .title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  width: fit-content;
}

/* Footer */
.app-footer {
  padding: 24px;
  text-align: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
