* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

header h1::before {
    content: '🗺️';
    font-size: 1.75rem;
}

.header-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.user-info {
    color: rgba(255, 255, 255, 0.95);
    margin-right: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 400px;
    background: #f8f9fa;
    padding: 1.5rem;
    overflow-y: auto;
    border-right: 1px solid #ddd;
}

.route-summary {
    background: #e8f0fe;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #1a73e8;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.summary-item:first-child {
    padding-top: 0;
}

.summary-item:last-child {
    padding-bottom: 0;
}

.summary-label {
    font-weight: 500;
    color: #202124;
    font-size: 0.875rem;
}

.summary-value {
    font-weight: 600;
    color: #1a73e8;
    font-size: 1rem;
}

.search-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #202124;
}

.waypoint-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.waypoint-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #dadce0;
    cursor: move;
    transition: all 0.2s ease;
}

.waypoint-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.waypoint-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.waypoint-item.drag-over {
    border-color: #1a73e8;
    border-width: 2px;
    background: #e8f0fe;
}

.waypoint-label {
    font-weight: 500;
    min-width: 45px;
    font-size: 0.875rem;
    color: #5f6368;
}

.place-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.875rem;
}

.place-input:focus {
    outline: none;
    border-color: #1a73e8;
}

.waypoint-type-selector {
    padding: 0.4rem 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.75rem;
    background: white;
    cursor: pointer;
    min-width: 70px;
}

.waypoint-type-selector:focus {
    outline: none;
    border-color: #1a73e8;
}

.stop-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #1a73e8;
}

.stop-name, .stop-duration {
    padding: 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.875rem;
}

.stop-notes {
    padding: 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
}

.stop-name:focus, .stop-duration:focus, .stop-notes:focus {
    outline: none;
    border-color: #1a73e8;
}

.btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: white;
    color: #1a73e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #1a73e8;
    border: 1px solid #1a73e8;
    width: 100%;
}

.btn-secondary:hover {
    background: #f0f7ff;
    border-color: #1557b0;
}

/* Header-specific button overrides */
header .btn-primary {
    background: white;
    color: #1a73e8;
}

header .btn-primary:hover {
    background: #f8f9fa;
}

header .btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: auto;
}

header .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-remove {
    padding: 0;
    width: 20px;
    height: 20px;
    background: rgba(244, 67, 54, 0.85);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove:hover:not(:disabled) {
    background: #f44336;
    transform: scale(1.1);
}

.btn-remove:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.route-info {
    margin-top: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dadce0;
}

.route-info h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #202124;
}

#routeDetails {
    font-size: 0.875rem;
    color: #5f6368;
}

.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #000;
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

#shareLink {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.875rem;
}

#copyBtn {
    white-space: nowrap;
}

.share-navigation-apps {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dadce0;
}

.share-navigation-apps p {
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.nav-buttons {
    display: flex;
    gap: 0.5rem;
}

.nav-buttons button {
    flex: 1;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
}

.pac-container {
    z-index: 1001;
    font-family: inherit;
}

/* Auth forms */
.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="email"] {
    padding: 0.75rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.875rem;
}

.modal-content input:focus {
    outline: none;
    border-color: #1a73e8;
}

.modal-content p {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

.modal-content a {
    color: #1a73e8;
    text-decoration: none;
}

.modal-content a:hover {
    text-decoration: underline;
}

/* Saved routes */
.saved-routes-section {
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dadce0;
}

.saved-routes-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #202124;
}

.saved-routes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.saved-route-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dadce0;
}

.route-name {
    font-weight: 500;
    color: #202124;
    flex: 1;
}

.route-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-load,
.btn-delete {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
}

.btn-load {
    background: #1a73e8;
    color: white;
}

.btn-load:hover {
    background: #1557b0;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #d32f2f;
}

.no-routes {
    text-align: center;
    color: #5f6368;
    font-size: 0.875rem;
    padding: 1rem;
}

/* Trip Management Styles */

.header-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex: 1;
    justify-content: space-between;
    margin-left: 2rem;
}

.trip-selector {
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 220px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.trip-selector:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.trip-selector:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.trip-selector option {
    background: #fff;
    color: #202124;
    padding: 0.5rem;
}

.trip-overview {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dadce0;
}

.trip-overview h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #202124;
}

.trip-description {
    font-size: 0.875rem;
    color: #5f6368;
    margin-bottom: 0.5rem;
}

.trip-dates {
    font-size: 0.875rem;
    color: #5f6368;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.trip-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.day-tabs-container {
    background: #fff;
    border-bottom: 1px solid #dadce0;
}

.day-tabs {
    display: flex;
    overflow-x: auto;
    padding: 0.5rem;
    gap: 0.25rem;
}

.day-tabs::-webkit-scrollbar {
    height: 4px;
}

.day-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.day-tabs::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.day-tab-wrapper {
    position: relative;
}

.day-tab {
    padding: 0.5rem 1rem;
    border: 1px solid #dadce0;
    background: #fff;
    color: #5f6368;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.day-tab:hover {
    background: #f8f9fa;
    border-color: #1a73e8;
}

.day-tab.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.day-date {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 0.1rem;
}

.day-delete-btn {
    padding: 0;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
    transition: all 0.2s;
}

.day-delete-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

.day-tab.active .day-delete-btn {
    background: rgba(255, 255, 255, 0.3);
}

.day-tab.active .day-delete-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.add-day-btn {
    padding: 0.5rem 1rem;
    border: 1px dashed #dadce0;
    background: #fff;
    color: #1a73e8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.add-day-btn:hover {
    background: #f8f9fa;
    border-color: #1a73e8;
    border-style: solid;
}

.daily-summary {
    background: #fff;
    padding: 1rem;
    border-bottom: 1px solid #dadce0;
}

.daily-summary h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #202124;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #5f6368;
    border-bottom: 1px solid #f1f1f1;
}

.summary-row:last-of-type {
    border-bottom: none;
}

.start-time-input {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e8eaed;
}

.start-time-input label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #202124;
    margin-bottom: 0.25rem;
}

.start-time-input input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
}

.start-time-input input:focus {
    outline: none;
    border-color: #1a73e8;
}

.overnight-input,
.notes-input {
    margin-top: 0.75rem;
}

.overnight-input label,
.notes-input label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #202124;
    margin-bottom: 0.25rem;
}

.overnight-input input,
.notes-input textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
}

.overnight-input input:focus,
.notes-input textarea:focus {
    outline: none;
    border-color: #1a73e8;
}

.notes-input textarea {
    resize: vertical;
    min-height: 60px;
}

/* Accommodation Details */
.accommodation-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e8eaed;
}

.accommodation-details h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #202124;
    margin-bottom: 0.75rem;
}

.accommodation-details .form-group {
    margin-bottom: 0.75rem;
}

.accommodation-details .form-group:last-child {
    margin-bottom: 0;
}

.accommodation-details label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #5f6368;
    margin-bottom: 0.25rem;
}

.accommodation-details input,
.accommodation-details textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
}

.accommodation-details input:focus,
.accommodation-details textarea:focus {
    outline: none;
    border-color: #1a73e8;
}

.accommodation-details textarea {
    resize: vertical;
    min-height: 50px;
}

/* Trip Modals */
#createTripModal form,
#editTripModal form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#createTripModal textarea,
#editTripModal textarea {
    min-height: 80px;
    padding: 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

#createTripModal label,
#editTripModal label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #5f6368;
    margin-top: 0.25rem;
}

#createTripModal input[type="date"],
#editTripModal input[type="date"] {
    padding: 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Arrival Time Display */
.arrival-time {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
}

/* Stop Type Selector (for future enhancement) */
.stop-type-selector {
    padding: 0.4rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #fff;
    cursor: pointer;
}

.stop-type-selector:focus {
    outline: none;
    border-color: #1a73e8;
}

/* Weather Display */
.weather-container {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.weather-loading {
    text-align: center;
    color: #5f6368;
    font-size: 0.9rem;
    padding: 0.5rem;
}

.weather-info h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #202124;
}

.weather-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weather-icon {
    width: 64px;
    height: 64px;
    margin: -8px;
}

.weather-details {
    flex: 1;
}

.weather-temp {
    font-size: 1.25rem;
    font-weight: 600;
    color: #202124;
    margin-bottom: 0.25rem;
}

.weather-condition {
    font-size: 0.9rem;
    color: #5f6368;
    text-transform: capitalize;
    margin-bottom: 0.25rem;
}

.weather-location {
    font-size: 0.85rem;
    color: #80868b;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .trip-selector {
        width: 100%;
    }

    .day-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
}
