* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
        Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* Prevent flash of login screen on initial load */
#app {
    visibility: hidden;
}

#app.ready {
    visibility: visible;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Navbar */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Container */
.container {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-control:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    color: #888;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: #2c3e50;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    overflow-y: visible;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

thead {
    background: #34495e;
    color: white;
}

th,
td {
    padding: 1rem;
    text-align: left;
    white-space: nowrap;
}

th {
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #95a5a6;
}

/* Map Controls */
.map-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.map-controls .form-control {
    width: auto;
    min-width: 200px;
}

/* Info Panel */
.info-panel {
    background: white;
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-panel h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

#location-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.location-detail-item {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.location-detail-label {
    font-weight: 500;
    color: #555;
    font-size: 0.85rem;
}

.location-detail-value {
    color: #333;
    margin-top: 0.25rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #95a5a6;
}

.close:hover {
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Error Message */
.error-message {
    color: #e74c3c;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fadbd8;
    border-radius: 6px;
    display: none;
}

.error-message.show {
    display: block;
}
/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .map-controls {
        flex-direction: column;
        width: 100%;
    }

    .map-controls .form-control {
        width: 100%;
    }

    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 0.5rem;
    }
}

/* Timeline Styles */
.timeline-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.timeline-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.summary-item {
    flex: 1;
    min-width: 150px;
}

.summary-label {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.timeline {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #3498db, #2ecc71);
}

.timeline-event {
    position: relative;
    padding-left: 70px;
    padding-bottom: 2rem;
    margin-bottom: 1rem;
}

.timeline-event:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: 20px;
    top: 5px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-event.stay .timeline-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.timeline-event.travel .timeline-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.timeline-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    border-left: 4px solid #3498db;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.timeline-event.stay .timeline-card {
    border-left-color: #667eea;
}

.timeline-event.travel .timeline-card {
    border-left-color: #f5576c;
}

.timeline-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.timeline-type {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}

.timeline-event.stay .timeline-type {
    color: #667eea;
}

.timeline-event.travel .timeline-type {
    color: #f5576c;
}

.timeline-duration {
    background: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.timeline-event.stay .timeline-duration {
    background: #667eea;
}

.timeline-event.travel .timeline-duration {
    background: #f5576c;
}

.timeline-time {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.timeline-location {
    color: #555;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.timeline-location-icon {
    margin-top: 0.15rem;
    color: #3498db;
}

.timeline-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.timeline-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.timeline-detail strong {
    color: #333;
}

.empty-message {
    text-align: center;
    color: #95a5a6;
    padding: 3rem;
    font-size: 1.1rem;
}

.timeline-map-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: background 0.3s;
}

.timeline-map-btn:hover {
    background: #2980b9;
}

@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-event {
        padding-left: 50px;
    }

    .timeline-icon {
        left: 0;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .timeline-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        width: 100%;
    }

    .timeline-summary {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Settings Page */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type='checkbox'] {
    width: auto;
    cursor: pointer;
}

.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.settings-actions {
    text-align: center;
    margin-top: 2rem;
}

.success-message {
    padding: 1rem;
    margin-top: 1rem;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    text-align: center;
}

#settings-message,
#settings-error {
    margin-top: 1rem;
}
