/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5 url('/img/bg.jpg') repeat;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 2000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header-brand {
    flex: 0 0 auto;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    line-height: 1;
}

.logo-icon {
    width: 70px;
    height: 70px;
    display: block;
    flex: 0 0 auto;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    background: #fff;
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
    padding: 1rem;
}

.main-nav a {
    text-decoration: none;
    color: #555;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #3498db;
}

/* Main Content */
main {
    min-height: calc(100vh - 160px);
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Features */
.features {
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Page Content */
.page-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-content > h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.page-content > p {
    color: #555;
    margin-bottom: 1.5rem;
}

.page-content .content {
    line-height: 1.8;
}

/* Map Section */
.map-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.map-section h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.map-section p {
    color: #555;
    margin-bottom: 1.5rem;
}

/* Contact Form */
.contact-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.contact-section h1 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.contact-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    cursor: pointer;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="checkbox"] {
    width: auto;
    padding: 0;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.home-action-btn {
    min-width: 180px;
    margin: 0.25rem 0;
    text-align: center;
}

.home-routes-section {
    margin: 1.5rem 0 0;
}

.home-routes-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.home-routes-table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.home-routes-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.home-routes-table th,
.home-routes-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.home-routes-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    white-space: nowrap;
}

.home-routes-table tbody tr:hover {
    background: #f8f9fa;
}

.home-routes-table tbody tr:last-child td {
    border-bottom: 0;
}

.home-route-name {
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.35;
}

.home-route-description {
    color: #7f8c8d;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-top: 0.2rem;
}

.home-route-date {
    white-space: nowrap;
}

.home-route-link-cell {
    text-align: right;
    white-space: nowrap;
}

.home-route-link {
    color: #3498db;
    font-weight: 600;
    text-decoration: none;
}

.home-route-link:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 1.5rem 0;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 6rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

/* Admin Login Page */
.admin-login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.login-hint {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Admin Layout */
.admin-page {
    background: #ecf0f1;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem;
    background: #1a252f;
}

.sidebar-header h2 {
    font-size: 1.25rem;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    border-bottom: 1px solid #34495e;
}

.sidebar-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav li.active a {
    background: #34495e;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-content {
    padding: 2rem;
    flex: 1;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.875rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stat-card a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.875rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e74c3c;
    color: #fff;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Admin Actions */
.admin-actions {
    margin-bottom: 1.5rem;
}

/* Admin Form Container */
.admin-form-container {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.admin-form-container h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Admin Table */
.admin-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.admin-table tr.unread {
    background: #fff3cd;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-right: 2rem;
}

.modal-content hr {
    margin: 1rem 0;
    border: none;
    border-top: 1px solid #eee;
}

/* Auth Section */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-container h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.auth-form {
    margin-top: 1rem;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #555;
}

.auth-link a {
    color: #3498db;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Profile Section */
.profile-section {
    padding: 2rem 0;
}

.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-section .profile-container,
.coordinates-section .profile-container,
.walks-section .profile-container {
    max-width: 100%;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.profile-header h1 {
    margin-bottom: 0.5rem;
}

.profile-header p {
    opacity: 0.9;
}

.profile-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.profile-nav a {
    padding: 0.75rem 1.5rem;
    background: #fff;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.profile-nav a:hover,
.profile-nav a.active {
    background: #3498db;
    color: #fff;
}

.profile-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-content h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.profile-form small {
    color: #7f8c8d;
    font-size: 0.875rem;
}

/* Coordinates Section */
.coordinates-section {
    padding: 2rem 0;
}

.coordinates-content {
    display: grid;
    gap: 2rem;
}

.add-coordinate-form,
.map-container,
.coordinates-list {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.add-coordinate-form h2,
.map-container h2,
.coordinates-list h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.map-hint {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin: 1rem 0;
}

.coordinates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.coordinate-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #eee;
}

.coordinate-card-muted {
    background: #fff1f1;
    border-color: #f5c2c7;
}

.coordinate-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.coordinate-card p {
    color: #555;
    margin-bottom: 0.5rem;
}

.coordinate-card .coords {
    font-family: monospace;
    font-size: 0.875rem;
    background: #eee;
    padding: 0.5rem;
    border-radius: 4px;
}

.coordinate-card .date {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

/* Extracted public page styles */
.is-hidden {
    display: none;
}

.inline-form {
    display: inline;
}

.map-canvas {
    width: 100%;
    position: relative;
    z-index: 0;
}

/* Hide Leaflet's generated attribution flag while keeping OSM attribution text visible. */
.leaflet-attribution-flag {
    display: none !important;
}

.map-canvas-large {
    height: 600px;
}

.map-canvas-medium {
    height: 400px;
}

.map-marker-icon {
    width: 32px;
    height: 32px;
}

.form-note {
    padding: 15px;
    background: #f0f8ff;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #2196f3;
}

.form-note p {
    margin: 0;
    font-size: 15px;
}

.map-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.map-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.map-modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.map-modal-close:hover {
    color: #666;
}

.modal-datetime {
    color: #666;
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.modal-creator,
.modal-joined,
.modal-route-info {
    color: #666;
}

.modal-creator,
.modal-joined {
    margin: 10px 0;
}

.modal-route-info {
    font-size: 14px;
}

.joined-users-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.joined-count {
    margin-bottom: 10px;
    font-size: 14px;
}

.joined-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 15px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
    max-height: 150px;
    overflow-y: auto;
}

.user-tag,
.joined-users-list .user-tag {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    margin: 3px;
    font-size: 12px;
}

.no-joined,
.route-empty-users {
    color: #999;
    font-style: italic;
    font-size: 13px;
}

.route-empty-users {
    color: #666;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    text-align: center;
}

.modal-actions .btn {
    margin: 0;
}

.speed-presets {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex: 0 0 auto;
}

.speed-input-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.form-group .speed-input-row input[type="number"] {
    width: auto;
    flex: 1 1 auto;
    min-width: 120px;
    height: 40px;
    padding-top: 0;
    padding-bottom: 0;
}

.speed-preset {
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 8px;
    min-height: 40px;
    padding: 0 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s;
}

.speed-preset:hover {
    background: #e0e0e0;
    border-color: #007bff;
}

.speed-preset.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.route-info {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 14px;
}

.distance,
.speed,
.start-time {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 5px;
}

.short-desc {
    color: #666;
    font-style: italic;
    margin-bottom: 5px;
}

.status-active,
.status-inactive {
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
}

.status-active {
    background: #28a745;
}

.status-inactive {
    background: red;
}

.full-desc {
    color: #444;
    margin-bottom: 10px;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.edit-header h2 {
    margin: 0;
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-success:hover {
    background: #218838;
}

.coords-button {
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
}

.walks-section {
    padding: 0;
}

.walks-content {
    margin-top: 30px;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    background: #f5f5f5;
    border-radius: 10px;
}

.empty-state p {
    margin-bottom: 1.25rem;
    color: #666;
}

.walks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.walk-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.walk-card h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.walk-card .short-desc {
    margin-bottom: 10px;
}

.walk-card .description-section {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.walk-card .description-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.walk-card .description {
    color: #444;
    margin: 0;
    line-height: 1.5;
}

.walk-card .route-info {
    margin: 15px 0;
}

.walk-card .distance,
.walk-card .speed,
.walk-card .start-time {
    background: #e9ecef;
}

.walk-card .creator,
.walk-card .coords,
.walk-card .date {
    font-size: 14px;
    margin-bottom: 10px;
    color: #555;
}

.walk-card-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.walk-card-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    height: 100%;
}

.route-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 20px 0;
}

.route-map {
    width: 100%;
    min-height: 520px;
    position: relative;
    z-index: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.route-details-panel {
    display: grid;
    grid-template-columns: minmax(320px, 1.35fr) minmax(300px, 1fr) minmax(260px, 0.9fr);
    gap: 16px;
    align-items: stretch;
}

.route-details-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    padding: 20px;
    min-width: 0;
}

.route-summary-section h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 26px;
    line-height: 1.25;
    color: #2c3e50;
}

.route-meta {
    color: #666;
    margin: 10px 0;
    font-size: 14px;
}

.route-description {
    margin: 0;
    line-height: 1.6;
    color: #444;
    overflow-wrap: anywhere;
}

.route-params-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.route-param-card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

.route-param-icon {
    grid-row: span 2;
    font-size: 20px;
}

.route-param-title {
    color: #7f8c8d;
    font-size: 12px;
}

.route-param-card strong {
    color: #2c3e50;
    font-size: 14px;
}

.route-users,
.route-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.route-users h3 {
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 18px;
}

.route-users-count {
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
}

.route-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.route-join-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: space-between;
}

.route-join-section .route-actions {
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.chat-area {
    margin-top: 30px;
    border: 1px solid #ddd;
    border-radius: 10px;
    height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
    font-size: 16px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fafafa;
}

.chat-message {
    max-width: 75%;
    display: flex;
    flex-direction: column;
}

.chat-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    word-wrap: break-word;
}

.chat-message-own {
    align-self: flex-end;
}

.chat-message-own .chat-message-bubble {
    background: #007bff;
    color: white;
}

.chat-message-header {
    line-height: 1.2;
    margin-bottom: 3px;
    padding: 0 4px;
}

.chat-message-username {
    font-size: 12px;
    font-weight: 600;
    color: #000;
    display: inline;
    margin-right: 6px;
}

.chat-message-time {
    font-size: 11px;
    color: #aaa;
    display: inline;
    margin-left: 2px;
    vertical-align: baseline;
}

.chat-input-area {
    padding: 12px 15px;
    border-top: 1px solid #ddd;
    background: white;
}

.chat-compose {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.chat-send-button {
    min-width: 108px;
    min-height: 40px;
    border: 0;
    border-radius: 20px;
    padding: 0 18px;
    background: #007bff;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.chat-send-button:hover:not(:disabled) {
    background: #0056b3;
}

.chat-send-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.chat-input:focus {
    border-color: #007bff;
}

.chat-message-text {
    white-space: pre-wrap;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.chat-message-text a,
.chat-message-text a:visited,
.chat-message-text a:hover,
.chat-message-text a:active,
.chat-message-text a:focus {
    color: inherit;
}

.chat-message-deleted .chat-message-bubble,
.chat-message-own.chat-message-deleted .chat-message-bubble {
    background: #e9ecef;
    color: #6c757d;
    box-shadow: none;
}

.chat-message-deleted .chat-message-text {
    font-style: italic;
}

.chat-message-username-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-message-delete {
    margin-left: 8px;
    border: 0;
    background: transparent;
    color: #dc3545;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 1px 2px;
    vertical-align: baseline;
    text-decoration: none;
}

.chat-message-delete:hover {
    opacity: 0.75;
    text-decoration: none;
}

.chat-message-delete-hard {
    color: #dc3545;
}

.chat-message-delete-soft {
    color: #c82333;
}

.chat-separator {
    display: flex;
    align-items: center;
    margin: 12px 0;
    color: #999;
    font-size: 12px;
    font-weight: 500;
    width: 100%;
}

.chat-separator::before,
.chat-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.chat-separator span {
    padding: 6px 16px;
    background: #e9ecef;
    border-radius: 12px;
    margin: 0 10px;
    white-space: nowrap;
}

.chat-empty-state {
    margin: auto;
    color: #777;
    font-style: italic;
    text-align: center;
}

.chat-load-older {
    align-self: center;
    border: 0;
    background: transparent;
    color: #007bff;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.chat-load-older:hover:not(:disabled) {
    color: #0056b3;
}

.chat-load-older:disabled {
    cursor: wait;
    opacity: 0.65;
}

.chat-ban-alert {
    margin-bottom: 10px;
}

.chat-login-required {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.chat-login-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.chat-login-required h3 {
    margin-bottom: 15px;
}

.chat-login-required p {
    color: #666;
    margin-bottom: 25px;
    max-width: 400px;
}

/* Alert Styles */
.alert ul {
    margin: 0;
    padding-left: 1.5rem;
}

.alert li {
    margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        position: relative;
        z-index: 2000;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .main-header .container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding-top: 94px;
        padding-bottom: 1rem;
    }

    .main-header-brand {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 2000;
        display: flex;
        align-items: center;
        padding: 0.75rem 20px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .main-header-brand .logo {
        margin: 0 auto;
    }

    .main-nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-wrapper {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-nav {
        flex-direction: column;
    }

    .coordinates-grid {
        grid-template-columns: 1fr;
    }

    .route-details-panel {
        grid-template-columns: 1fr;
    }

    .route-params-grid {
        grid-template-columns: 1fr;
    }

    .chat-area {
        height: 70vh;
        min-height: 420px;
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 8px;
    }

    .chat-header {
        padding: 10px 14px;
        font-size: 15px;
    }

    .chat-messages {
        padding: 10px;
        gap: 8px;
    }

    .chat-message {
        max-width: 88%;
    }

    .chat-message-bubble {
        padding: 9px 12px;
        border-radius: 16px;
    }

    .chat-input-area {
        padding: 8px;
    }

    .chat-compose {
        gap: 8px;
    }

    .chat-input {
        min-height: 44px;
        font-size: 16px;
        border-radius: 22px;
    }

    .chat-send-button {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        border-radius: 50%;
        padding: 0;
        font-size: 0;
    }

    .chat-send-button::before {
        content: '➤';
        font-size: 18px;
        line-height: 1;
    }

    .chat-separator span {
        padding: 6px 12px;
        margin: 0 6px;
        font-size: 11px;
    }
}

@media (max-width: 992px) {
    .route-details-panel {
        grid-template-columns: 1fr 1fr;
    }

    .route-summary-section {
        grid-column: 1 / -1;
    }

    .route-map {
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 1rem;
    }

    .add-coordinate-form,
    .map-container,
    .coordinates-list {
        padding: 1rem;
    }

    .speed-input-row {
        flex-direction: column;
    }

    .speed-input-row,
    .speed-presets,
    .card-actions,
    .route-info {
        flex-wrap: wrap;
    }

    .form-group .speed-input-row input[type="number"] {
        width: 100%;
        min-width: 0;
    }

    .speed-presets {
        width: 100%;
    }

    .speed-preset {
        flex: 1 1 0;
        padding-left: 8px;
        padding-right: 8px;
    }

    .card-actions .btn {
        flex: 1 1 100%;
        text-align: center;
    }

    .coordinate-card,
    .coordinate-card h3,
    .short-desc,
    .full-desc {
        overflow-wrap: anywhere;
    }

    .route-details-panel {
        grid-template-columns: 1fr;
    }

    .route-params-section,
    .route-join-section {
        grid-column: 1 / -1;
        width: 100%;
    }

    .route-params-grid {
        grid-template-columns: 1fr;
    }

    .route-param-card strong {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-actions .btn {
        width: 100%;
    }
}
