/* Basic Layout */
html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow: hidden; /* Prevent scrollbars from appearing */
  font-family: 'Inter', sans-serif;
}

/* Map Container - Full screen with breathing room */
#map {
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  bottom: 0;
  width: calc(100% - 20px);
  height: 100vh;
  z-index: 0;
  border-radius: 8px;
}

/* Header */
.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  background: transparent !important; /* Override existing styles */
  box-shadow: none !important;
  padding: 15px 0;
  transition: background-color 0.3s ease;
}

.header .container {
    max-width: 1400px;
}

.header .header-content {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Control Panel */
#control-panel {
  position: absolute;
  top: 90px;
  left: 30px;
  width: 400px;
  min-width: 400px;
  max-width: 520px;
  max-height: calc(100vh - 110px);
  background: #fff;
  z-index: 15;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease;
}

#panel-content {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

#status-container {
    padding: 12px 24px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

#otp-status {
    font-size: 13px;
    color: #6c757d;
}

#status-indicator {
    color: #6c757d; /* Default gray */
}

/* State 1: Search View */
#search-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.address-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.address-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

.address-input:focus {
    border-color: #12a37a;
    box-shadow: 0 0 0 3px rgba(18, 163, 122, 0.1);
    outline: none;
}

#options-toggle-container {
    cursor: pointer;
    user-select: none;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid #e9ecef;
}

#options-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #343a40;
    font-weight: 600;
    padding: 8px 0;
}

#options-toggle svg {
    transition: transform 0.2s ease-in-out;
}

.preferences {
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 20px;
    padding-left: 22px; /* Indent under toggle */
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pref-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pref-group > label {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.checkbox-group, .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
}
.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.time-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

#planBtn {
    padding: 14px 24px;
    background: #12a37a;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 8px;
    transition: all 0.2s ease;
}

#planBtn:hover {
    background: #0f8b67;
    transform: translateY(-1px);
}
#planBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Placeholder buttons */
.biking-option-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ced4da;
    background-color: #fff;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.biking-option-btn.active {
    background-color: #12a37a;
    border-color: #12a37a;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(18, 163, 122, 0.2);
}
.biking-option-btn:hover:not(.active) {
    border-color: #adb5bd;
}


.advanced-options-group {
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.advanced-options-group label {
    font-size: 14px;
    margin-bottom: 4px;
    display: block;
}

.adv-slider {
     width: 100%;
}

/* --- State 2 & 3 --- */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #495057;
    padding: 8px;
    margin: -8px; /* Offset padding */
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.back-btn:hover {
    background-color: #f1f3f5;
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

/* Results View (State 2) */
.results-view-header, .detail-view-header {
    margin-bottom: 20px;
}

.route-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.route-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #fff;
}

.route-card:hover {
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.route-card.highlighted {
    border-color: #12a37a;
    background-color: #f8fdfb;
    box-shadow: 0 4px 15px rgba(18, 163, 122, 0.1);
}

.route-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.route-card-time {
    font-size: 22px;
    font-weight: 700;
    color: #212529;
    min-width: 80px;
}

.route-card-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.route-card-modes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-card-modes span svg {
    width: 20px;
    height: 20px;
    color: #495057;
}

.route-card-range {
    font-size: 14px;
    color: #6c757d;
}

/* Detail View (State 3) */

.detail-summary {
    text-align: center;
    padding: 12px 0;
    margin-top: 16px;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}
.detail-summary-time {
    font-size: 28px;
    font-weight: 700;
}
.detail-summary-range {
    font-size: 15px;
    color: #6c757d;
}

.detail-itinerary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.itinerary-leg {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f5;
}
.itinerary-leg:last-child {
    border-bottom: none;
}

.leg-icon svg {
    width: 28px;
    height: 28px;
    color: #343a40;
}

.leg-details {
    flex-grow: 1;
}

.leg-description {
    font-size: 15px;
    color: #212529;
}

.leg-description .leg-mode {
    font-weight: 600;
}

.leg-info {
    font-size: 13px;
    color: #6c757d;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    #map {
        left: 5px;
        right: 5px;
        width: calc(100% - 10px);
    }
    
    #control-panel {
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        left: 15px;
        right: 15px;
        top: 15px;
        max-height: calc(100vh - 30px);
    }

    .header {
        display: none; /* Hide desktop header on mobile for cleaner look */
    }

    body {
        /* Add some padding at the top for mobile status bar */
        padding-top: env(safe-area-inset-top);
    }
}