/* ==============================================================
   City on Social Park — Brand styles
   Color palette inspired by cityon.gr (urban / smart-city feel)
   ============================================================== */

:root {
  /* Brand */
  --primary:        #00B7C7;   /* CityOn teal */
  --primary-dark:   #008A99;
  --primary-light:  #4ECDD8;
  --primary-soft:   #E0F7FA;

  --secondary:      #003B5C;   /* Deep navy */
  --secondary-soft: #DCE7EE;

  --accent:         #FF6B35;   /* Orange CTA */
  --accent-dark:    #E55A2B;
  --accent-soft:    #FFE5D9;

  /* Surfaces */
  --bg:             #F4F8FB;
  --card:           #FFFFFF;
  --border:         #E1E8ED;

  /* Text */
  --text:           #1A2B42;
  --text-muted:     #5C7080;
  --text-inverse:   #FFFFFF;

  /* Semantic */
  --success:        #10B981;
  --warning:        #F59E0B;
  --danger:         #EF4444;
  --info:           #3B82F6;
  --muted:          #94A3B8;

  /* Shadows */
  --shadow-sm:      0 1px 2px rgba(0,59,92,0.06);
  --shadow:         0 4px 12px rgba(0,59,92,0.08);
  --shadow-lg:      0 12px 32px rgba(0,59,92,0.14);

  --radius-sm:      8px;
  --radius:         14px;
  --radius-lg:      20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { color: var(--secondary); font-weight: 700; }
h1 { font-size: 1.75rem; margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 0 0 .5rem; }
h3 { font-size: 1.10rem; margin: 0 0 .5rem; }
p  { margin: 0 0 .75rem; }

/* ------------ Layout ------------ */
.container { max-width: 1320px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 2rem 0; }

/* ------------ Top Navigation ------------ */
.topbar {
  background: linear-gradient(135deg, var(--secondary) 0%, #00557A 100%);
  color: var(--text-inverse);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 1000;
}
.topbar .nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.25rem; max-width: 1320px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  color: var(--text-inverse); font-weight: 800; font-size: 1.05rem;
}
.brand-logo {
  height: 40px;
  background: #fff;
  border-radius: 10px;
  padding: 5px 9px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
.brand-logo img { height: 100%; width: auto; display: block; }
.auth-card .brand-logo { background: transparent; box-shadow: none; padding: 0; height: 56px; }
.brand-title { line-height: 1.1; }
.brand-title small { display: block; font-size: .68rem; font-weight: 500; opacity: .8; letter-spacing: .04em; text-transform: uppercase; }
.nav-links { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0; align-items: center; }
.nav-links a {
  color: rgba(255,255,255,0.85); padding: .55rem .85rem; border-radius: 999px;
  font-weight: 500; transition: background .15s, color .15s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.12); color: #fff;
}
.nav-user {
  display: flex; align-items: center; gap: .65rem;
  padding: .35rem .35rem .35rem .85rem;
  background: rgba(255,255,255,0.10); border-radius: 999px;
}
.nav-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: var(--secondary);
  display: grid; place-items: center; font-weight: 700;
}
.btn-cta {
  background: var(--accent); color: #fff !important; padding: .55rem 1.1rem !important;
  border-radius: 999px !important; font-weight: 600;
}
.btn-cta:hover { background: var(--accent-dark); }

/* ------------ Cards ------------ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  border: 1px solid var(--border);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { margin: 0; }

/* ------------ Buttons ------------ */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.1rem; border: 1px solid transparent;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
  cursor: pointer; transition: all .15s; text-decoration: none;
  background: var(--card); color: var(--text);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary  { background: var(--primary);   color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); color: #fff; }
.btn-secondary{ background: var(--secondary); color: #fff; }
.btn-secondary:hover{ background: #002A42; color: #fff; }
.btn-accent   { background: var(--accent);    color: #fff; }
.btn-accent:hover   { background: var(--accent-dark); color: #fff; }
.btn-danger   { background: var(--danger);    color: #fff; }
.btn-success  { background: var(--success);   color: #fff; }
.btn-ghost    { background: transparent; border-color: var(--border); }
.btn-sm { padding: .35rem .75rem; font-size: .82rem; }

/* ------------ Forms ------------ */
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 600; color: var(--secondary); margin-bottom: .35rem; font-size: .88rem; }
.input, .select, .textarea {
  width: 100%; padding: .65rem .85rem; font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-help { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.checkbox-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .75rem; background: var(--bg); border-radius: var(--radius-sm);
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ------------ Badges ------------ */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 600;
  background: var(--bg); color: var(--text-muted); border: 1px solid var(--border);
}
.badge-success { background: #DCFCE7; color: #065F46; border-color: #BBF7D0; }
.badge-warning { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.badge-danger  { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.badge-info    { background: #DBEAFE; color: #1E40AF; border-color: #BFDBFE; }
.badge-muted   { background: #F1F5F9; color: #475569; border-color: #E2E8F0; }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); border-color: #B2EBF2; }

/* ------------ Tables ------------ */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: var(--radius); overflow: hidden;
}
table.data th, table.data td {
  padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
table.data th {
  background: var(--bg); font-weight: 600; color: var(--secondary);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
}
table.data tr:hover { background: #F9FBFD; }
table.data tr:last-child td { border-bottom: none; }
.actions { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ------------ Stats / KPI ------------ */
.stats-grid {
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--primary);
}
.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-danger::before  { background: var(--danger); }
.stat-card.stat-info::before    { background: var(--info); }
.stat-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat-value { font-size: 2.2rem; font-weight: 800; color: var(--secondary); line-height: 1.1; margin-top: .25rem; }
.stat-help { font-size: .8rem; color: var(--text-muted); margin-top: .4rem; }

/* ------------ Map ------------ */
.map-container { height: 70vh; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.map-legend {
  position: absolute; bottom: 14px; left: 14px; z-index: 500;
  background: rgba(255,255,255,0.97); padding: .85rem 1rem;
  border-radius: var(--radius); box-shadow: var(--shadow); font-size: .82rem;
  border: 1px solid var(--border); max-width: 240px;
}
.legend-row { display: flex; align-items: center; gap: .55rem; margin-bottom: .35rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; }

.leaflet-popup-content-wrapper { border-radius: var(--radius) !important; }
.leaflet-popup-content { margin: .85rem 1rem !important; line-height: 1.5; }
.popup-title { color: var(--secondary); font-weight: 700; margin-bottom: .35rem; }
.popup-actions { margin-top: .5rem; display: flex; gap: .35rem; }

/* ------------ Hero / Landing ------------ */
.hero {
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--accent-soft) 100%);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}
.hero h1 { font-size: 2.2rem; }
.hero p { font-size: 1.05rem; color: var(--text); max-width: 700px; }
.hero-actions { margin-top: 1.25rem; display: flex; gap: .65rem; flex-wrap: wrap; }

/* ------------ Layouts ------------ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.split-3-1 { display: grid; grid-template-columns: 3fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) {
  .split, .split-3-1 { grid-template-columns: 1fr; }
  .hero { padding: 2rem 1.25rem; }
  .hero h1 { font-size: 1.7rem; }
}

/* ------------ Alerts ------------ */
.alert {
  padding: .85rem 1.1rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; font-size: .92rem;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft); color: var(--secondary);
}
.alert.alert-success { background: #DCFCE7; border-color: var(--success); color: #065F46; }
.alert.alert-warning { background: #FEF3C7; border-color: var(--warning); color: #92400E; }
.alert.alert-danger  { background: #FEE2E2; border-color: var(--danger);  color: #991B1B; }

/* ------------ Footer ------------ */
.site-footer {
  margin-top: 3rem; padding: 2rem 0;
  background: var(--secondary); color: rgba(255,255,255,0.85);
  font-size: .88rem;
}
.site-footer a { color: var(--primary-light); }
.footer-inner { max-width: 1320px; margin: 0 auto; padding: 0 1.25rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* ------------ Login screen ------------ */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--secondary) 0%, #00557A 70%, var(--primary) 100%);
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 2.25rem;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.auth-card .brand { color: var(--secondary); justify-content: center; margin-bottom: 1.25rem; }
.auth-card h1 { text-align: center; margin-bottom: .25rem; font-size: 1.5rem; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; }
.auth-card .test-accounts {
  background: var(--bg); border-radius: var(--radius-sm); padding: 1rem;
  margin-top: 1.5rem; font-size: .82rem; color: var(--text-muted);
}
.auth-card .test-accounts code { background: #fff; padding: 1px 5px; border-radius: 4px; color: var(--accent-dark); }
.auth-card .test-accounts strong { color: var(--secondary); }

/* ------------ Misc ------------ */
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.flex-gap { display: flex; gap: .5rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
