html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

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

.route-panel {
    position: absolute;
    top: 20px;
    left: 50px;
    z-index: 1000;

    width: 300px;
    padding: 20px;

    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.route-panel h2 {
    margin-top: 0;
}

.route-panel label {
    display: block;
    margin-top: 5px;
}

.route-panel input {
    box-sizing: border-box;
    width: 100%;
    padding: 10px;
    margin-top: 5px;
}

.route-panel button {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    cursor: pointer;
}

#status {
    font-size: 14px;
}
.suggestions {
    position: relative;
    z-index: 1001;
}

.suggestion-item {
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 14px;
}

.suggestion-item:hover {
    background: #f0f0f0;
}

.route-panel input[type="date"],
.route-panel input[type="time"] {
    box-sizing: border-box;
    width: 100%;
    padding: 10px;
    margin-top: 5px;
}

.weather-card h4 {
    margin-top: 0;
}

.weather-map-icon {
    background: transparent;
    border: none;
}

.weather-marker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70px;
}

.weather-icon-circle {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 23px;

    background: white;
    border: 2px solid #333;
    border-radius: 50%;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.weather-temperature-label {
    margin-top: 2px;
    padding: 2px 5px;

    background: white;
    border: 1px solid #555;
    border-radius: 5px;

    font-size: 11px;
    font-weight: bold;
    color: #222;
    white-space: nowrap;

    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.weather-popup h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.weather-popup p {
    margin: 5px 0;
}

.route-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}

#minimize-route-panel {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #e5e7eb;
    font-size: 22px;
    cursor: pointer;
}

#minimize-route-panel:hover {
    background: #d1d5db;
}

#route-panel-content {
    display: block;
}

#route-panel.minimized #route-panel-content {
    display: none;
}

#route-panel.minimized .route-panel-header {
    margin-bottom: 0;
}

#show-route-panel {
    position: absolute;
    top: 15px;
    right: auto;
    left: 15px;
    z-index: 1000;

    padding: 12px 18px;
    border: none;
    border-radius: 8px;

    background: #e5e7eb;
    color: #222;

    font-size: 14px;
    font-weight: bold;
    cursor: pointer;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#show-route-panel:hover {
    background: #d1d5db;
}

#show-route-panel[hidden] {
    display: none;
}

#route-panel.hidden {
    display: none;
}


.route-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 42px;
    margin-bottom: 10px;
    padding: 0 5px;
}

.route-panel-header strong {
    text-align: left;
    font-size: 16px;
}

#minimize-route-panel {
    width: 36px;
    height: 36px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 8px;

    background: #e5e7eb;
    font-size: 22px;
    cursor: pointer;
}

#minimize-route-panel:hover {
    background: #d1d5db;
}

#route-panel-content {
    display: block;
}

.route-panel.minimized #route-panel-content {
    display: none;
}

.route-panel.minimized .route-panel-header {
    margin-bottom: 0;
}

.route-panel.hidden {
    display: none;
}

#show-route-panel {
    position: absolute;
    top: 15px;
    left: 50px;
    right: auto;

    width: fit-content;
    max-width: calc(100vw - 30px);
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 18px;
    border: none;
    border-radius: 8px;

    background: #e5e7eb;
    color: #222;

    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    cursor: pointer;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#show-route-panel:hover {
    background: #1d4ed8;
}

#show-route-panel[hidden] {
    display: none;
}

@media (max-width: 600px) {
    #show-route-panel {
        top: 15px;
        left: 15px;
        right: auto;
        width: fit-content;
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* =====================================
   AI ROAD TRIP ASSISTANT PANEL
===================================== */

#ai-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;

    width: 350px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 30px);

    display: flex;
    flex-direction: column;

    background: white;
    border-radius: 12px;

    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);

    overflow: hidden;
}


/* Assistant header */

.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px;

    border-bottom: 1px solid #e5e7eb;
}

.ai-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-icon {
    font-size: 27px;
    color: #2563eb;
}

.ai-title h2 {
    font-size: 16px;
    margin: 0;
}

.ai-title p {
    font-size: 11px;
    color: #6b7280;
    margin: 4px 0 0;
}


/* Minimize button */

#minimize-ai-panel {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 7px;

    background: #e5e7eb;

    font-size: 21px;
    cursor: pointer;
}


/* Scrollable content */

#ai-panel-content {
    padding: 15px;
    overflow-y: auto;
}

#ai-panel.minimized #ai-panel-content {
    display: none;
}

.ai-intro {
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    margin-top: 0;
}


/* Generate report button */

#generate-ai-report {
    width: 100%;
    padding: 12px;

    border: none;
    border-radius: 8px;

    background: #2563eb;
    color: white;

    font-size: 14px;
    font-weight: bold;

    cursor: pointer;
}

#generate-ai-report:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.ai-coming-soon {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    margin: 8px 0 15px;
}


/* Report sections */

.ai-section {
    padding: 13px 0;
    border-top: 1px solid #e5e7eb;
}

.ai-section-heading {
    display: flex;
    align-items: center;
    gap: 9px;
}

.ai-section-heading span {
    font-size: 19px;
}

.ai-section-heading h3 {
    font-size: 14px;
    margin: 0;
}

.ai-placeholder {
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
    margin: 8px 0 0;
}


/* Fuel vehicle selector */

#vehicle-category {
    width: 100%;
    padding: 9px;
    margin-top: 9px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    background: white;
    font-size: 13px;
}


/* Chat input */

#ai-chat-input {
    width: 100%;
    box-sizing: border-box;

    padding: 10px;
    margin-top: 10px;

    border: 1px solid #d1d5db;
    border-radius: 6px;
}


/* Minimized state */

#ai-panel.minimized #ai-panel-content {
    display: none;
}


/* =====================================
   MOBILE LAYOUT
===================================== */

@media (max-width: 750px) {

    #ai-panel {
        top: auto;
        bottom: 15px;
        right: 10px;

        width: 310px;
        max-height: 55vh;
    }

}

/* =====================================
   FUEL CALCULATOR
===================================== */

#fuel-section label {
    display: block;
    margin-top: 12px;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

#fuel-section select,
#fuel-section input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 13px;
}

#fuel-results {
    margin-top: 15px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 8px;
}

.fuel-result-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

.fuel-result-row:last-of-type {
    margin-bottom: 0;
}

.fuel-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #d1d5db;
    font-size: 14px;
}

.fuel-total strong {
    color: #15803d;
    font-size: 18px;
}
/* ====================================
   AI TRAVEL REPORT
==================================== */

#ai-report-results {
    margin-top: 16px;
}

.ai-report-content {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 10px;
    white-space: pre-line;
}

#ai-risk-level {
    font-weight: bold;
    margin-bottom: 10px;
}

#ai-overall-summary {
    line-height: 1.6;
    margin-bottom: 16px;
}

#ai-travel-tips ul {
    padding-left: 20px;
}

#ai-travel-tips li {
    margin-bottom: 8px;
}

#generate-ai-report:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* AI travel risk indicators */

#ai-risk-level {
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
}

#ai-risk-level.risk-low {
    background: #dcfce7;
    color: #166534;
}

#ai-risk-level.risk-moderate {
    background: #fef3c7;
    color: #92400e;
}

#ai-risk-level.risk-high {
    background: #fee2e2;
    color: #991b1b;
}


/* ====================================
   AI CHATBOT
==================================== */

#ai-panel #ai-chat-messages {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;

    width: 100%;
    box-sizing: border-box;
    max-height: 300px;
    overflow-y: auto;

    padding: 12px;
    margin: 12px 0;

    background: #f8fafc;
    border-radius: 10px;

    text-align: left;
}

#ai-panel #ai-chat-messages .chat-message {
    display: block;
    width: auto;
    max-width: 85%;
    box-sizing: border-box;

    padding: 10px 14px;
    margin: 0;

    border-radius: 10px;

    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;

    text-align: left;
    text-indent: 0;
    white-space: normal;
    overflow-wrap: break-word;
}

#ai-panel #ai-chat-messages .assistant-message {
    align-self: flex-start;
    background: #e2e8f0;
    color: #1e293b;
}

#ai-panel #ai-chat-messages .user-message {
    align-self: flex-end;
    background: #dbeafe;
    color: #1e40af;
}

#ai-panel .ai-chat-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

#ai-panel .ai-chat-input-container input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
}

#ai-panel #ai-chat-send {
    flex-shrink: 0;
}
