/* static/style.css */

/* --- Global Styles & Variables --- */
:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --light-gray: #f5f7fa;
  --medium-gray: #ecf0f1;
  --dark-gray: #7f8c8d;
  --white: #ffffff;
  --border-color: #ddd;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 20px;
  background-color: var(--light-gray);
  color: var(--secondary-color);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--white);
  padding: 25px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

h2 {
  color: var(--secondary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
  margin-top: 0;
}

h3 {
  color: var(--secondary-color);
  margin-top: 0;
}

/* --- Buttons --- */
.btn, button {
  padding: 10px 18px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  color: var(--white);
  transition: opacity 0.2s;
  text-decoration: none;
  display: inline-block;
}

button:hover, .btn:hover {
  opacity: 0.85;
}

.btn-primary, button[type="submit"] { background-color: var(--primary-color); }
.btn-success, #add-stop-btn { background-color: var(--success-color); }
.btn-warning, .edit-stop { background-color: var(--warning-color); margin-right: 5px;}
.btn-danger, .delete-stop { background-color: var(--danger-color); }
.btn-secondary, #cancel-edit { background-color: var(--dark-gray); }
.btn.logout { background-color: var(--danger-color); padding: 8px 15px;}


/* --- Forms --- */
form input[type="text"],
form input[type="password"],
form input[type="number"],
form select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  box-sizing: border-box;
}

/* --- Login Page --- */
.login-container {
  max-width: 400px;
  text-align: center;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.error-message {
  color: var(--danger-color);
  background: #fadbd8;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
}

/* --- Dashboard Page --- */
.dashboard-container { max-width: 1400px; }
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}
.map-section { display: flex; gap: 20px; margin-bottom: 20px; }
#map { flex: 3; height: 500px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.bus-list-container {
  flex: 1;
  background: var(--white);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  height: 500px;
  overflow-y: auto;
}
#bus-ul { list-style: none; padding: 0; }
#bus-ul li { padding: 10px; margin-bottom: 8px; background: var(--light-gray); border-radius: 4px; }

.timeline-editor { background: var(--white); padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
#stop-form { background: var(--medium-gray); padding: 20px; border-radius: 8px; margin: 20px 0; }
#stop-form-content { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-actions { grid-column: span 2; display: flex; justify-content: flex-end; gap: 10px; }

#timeline-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
#timeline-table th, #timeline-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; }
#timeline-table th { background-color: var(--primary-color); color: white; }
#timeline-table tr:hover { background-color: #f5f5f5; }


/* --- Public Page --- */
.data-panel { display: flex; gap: 20px; margin: 25px 0; }
.data-item { background: var(--medium-gray); padding: 20px; border-radius: 8px; flex: 1; text-align: center; }
.data-item strong { display: block; color: var(--dark-gray); font-size: 1em; margin-bottom: 8px; }
.data-value { font-size: 1.8em; font-weight: bold; color: var(--secondary-color); }

.timeline { margin: 30px 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}
.timeline-item { position: relative; padding-left: 50px; margin-bottom: 30px; }
.timeline-marker {
  position: absolute;
  left: 10px;
  top: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 4px solid var(--white);
  box-shadow: 0 0 0 3px var(--primary-color);
}
.timeline-content { background: var(--medium-gray); padding: 15px 20px; border-radius: 8px; }
.timeline-content h3 { margin-top: 0; color: var(--secondary-color); }
