/* Google Maps Design System & Aesthetic */
:root {
    --gmaps-bg: #f8f9fa;
    --gmaps-surface: #ffffff;
    --gmaps-border: #dadce0;
    --gmaps-text-primary: #202124;
    --gmaps-text-secondary: #5f6368;
    --gmaps-blue: #1a73e8;
    --gmaps-blue-hover: #1765cc;
    --gmaps-red: #ea4335;
    --gmaps-yellow: #fbbc04;
    --gmaps-green: #34a853;
    --gmaps-whatsapp: #25d366;
    
    --gmaps-shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --gmaps-shadow-md: 0 2px 6px 0 rgba(60,64,67,0.3), 0 1px 2px 0 rgba(60,64,67,0.15);
    --gmaps-shadow-lg: 0 4px 16px 0 rgba(60,64,67,0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-full: 24px;
    --font-family: 'Google Sans', 'Roboto', -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--gmaps-bg);
    color: var(--gmaps-text-primary);
}

/* Layout */
.gmaps-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Map Container */
.gmaps-map-container {
    flex: 1;
    height: 100%;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background-color: #e5e3df;
}

/* Floating Search Container Top Left */
.gmaps-search-container {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 390px;
    max-width: calc(100vw - 24px);
}

.gmaps-search-card {
    background: var(--gmaps-surface);
    border-radius: var(--radius-full);
    box-shadow: var(--gmaps-shadow-md);
    display: flex;
    align-items: center;
    padding: 4px 12px;
    height: 48px;
}

.gmaps-icon-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gmaps-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.gmaps-icon-btn:hover {
    background: rgba(60,64,67,0.08);
}

.gmaps-search-card input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 8px;
    font-size: 0.95rem;
    color: var(--gmaps-text-primary);
    background: transparent;
}

.search-divider {
    width: 1px;
    height: 24px;
    background: var(--gmaps-border);
    margin: 0 6px;
}

.gmaps-action-pill {
    background: #f1f3f4;
    border: none;
    border-radius: 16px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gmaps-text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.gmaps-action-pill:hover {
    background: #e8eaed;
}

/* Category Filter Pills Bar */
.gmaps-category-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.gmaps-category-pills::-webkit-scrollbar {
    display: none;
}

.pill-btn {
    background: var(--gmaps-surface);
    border: 1px solid var(--gmaps-border);
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gmaps-text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--gmaps-shadow-sm);
    transition: all 0.2s;
}

.pill-btn:hover, .pill-btn.active {
    background: #e8f0fe;
    color: var(--gmaps-blue);
    border-color: var(--gmaps-blue);
}

/* Floating Controls Bottom Right */
.gmaps-controls-bottom {
    position: absolute;
    bottom: 24px;
    right: 12px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gmaps-round-control, .gmaps-layer-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gmaps-surface);
    border: none;
    box-shadow: var(--gmaps-shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--gmaps-text-secondary);
    cursor: pointer;
    transition: background 0.2s;
}

.gmaps-round-control:hover, .gmaps-layer-btn:hover {
    background: #f1f3f4;
}

/* Sidebar Drawer */
.gmaps-sidebar {
    width: 400px;
    background: var(--gmaps-surface);
    border-right: 1px solid var(--gmaps-border);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    box-shadow: var(--gmaps-shadow-lg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
}

.gmaps-sidebar:not(.open) {
    transform: translateX(-100%);
}

.gmaps-sidebar-toggle-tab {
    position: absolute;
    top: 70px;
    left: 12px;
    z-index: 1040;
    background: var(--gmaps-surface);
    border: 1px solid var(--gmaps-border);
    border-radius: 0 8px 8px 0;
    width: 32px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--gmaps-shadow-md);
    cursor: pointer;
    color: var(--gmaps-text-secondary);
}

.gmaps-sidebar-header {
    padding: 16px 16px 12px 16px;
    border-bottom: 1px solid var(--gmaps-border);
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.gmaps-logo-badge {
    width: 38px;
    height: 38px;
    background: var(--gmaps-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
}

.header-title-row h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gmaps-text-primary);
}

.gmaps-subtext {
    font-size: 0.75rem;
    color: var(--gmaps-text-secondary);
}

.sidebar-close-btn {
    margin-left: auto;
}

/* Stats Bar */
.gmaps-stats-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.stat-pill {
    background: #f1f3f4;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    color: var(--gmaps-text-secondary);
    white-space: nowrap;
}

.stat-pill strong {
    color: var(--gmaps-text-primary);
}

/* Filters Select Row */
.gmaps-filters-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.gmaps-select {
    flex: 1;
    background: #f1f3f4;
    border: 1px solid var(--gmaps-border);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.75rem;
    color: var(--gmaps-text-primary);
    outline: none;
}

.gmaps-text-link {
    background: none;
    border: none;
    color: var(--gmaps-blue);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
}

.gmaps-summary-strip {
    padding: 8px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--gmaps-border);
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--gmaps-text-secondary);
}

.summary-tag {
    font-weight: 700;
    color: var(--gmaps-blue);
}

/* Google Maps Results List */
.gmaps-results-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.gmaps-place-card {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gmaps-place-card:hover, .gmaps-place-card.active {
    background: #f1f5fe;
}

.place-card-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--gmaps-text-primary);
    line-height: 1.3;
}

.place-rating-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.rating-score {
    font-weight: 700;
    color: var(--gmaps-text-primary);
}

.stars-gold {
    color: #fbbc04;
    font-size: 0.75rem;
}

.reviews-text {
    color: var(--gmaps-text-secondary);
    font-size: 0.75rem;
}

.place-category {
    font-size: 0.78rem;
    color: var(--gmaps-text-secondary);
}

.place-address {
    font-size: 0.78rem;
    color: var(--gmaps-text-secondary);
    line-height: 1.3;
}

.place-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.btn-gmaps-primary {
    background: var(--gmaps-blue);
    color: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    cursor: pointer;
}

.btn-gmaps-secondary {
    background: #f1f3f4;
    color: var(--gmaps-text-primary);
    border: 1px solid var(--gmaps-border);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    cursor: pointer;
}

.btn-gmaps-success {
    background: var(--gmaps-green);
    color: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    cursor: pointer;
}

/* Modal Overlay & Google Maps Detail Side Panel */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gmaps-place-detail-card, .gmaps-modal-card {
    background: var(--gmaps-surface);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.gmaps-modal-header {
    padding: 24px 24px 0 24px;
}

.gmaps-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gmaps-text-primary);
    display: flex;
    align-items: center;
}

.modal-desc {
    font-size: 0.82rem;
    color: var(--gmaps-text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

.gmaps-modal-body {
    padding: 20px 24px 24px 24px;
}

.dark-close {
    background: rgba(0, 0, 0, 0.08) !important;
    color: var(--gmaps-text-primary) !important;
}

.dark-close:hover {
    background: rgba(0, 0, 0, 0.15) !important;
}

/* Upload Drop Zone Styles */
.drop-zone {
    border: 2px dashed #1a73e8;
    background: #f4f8fe;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.drop-zone:hover, .drop-zone.dragover {
    background: #e8f0fe;
    border-color: #1557b0;
    transform: scale(1.01);
}

.drop-zone-icon {
    width: 54px;
    height: 54px;
    background: #e8f0fe;
    color: #1a73e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 12px auto;
}

.drop-zone-title {
    font-size: 0.95rem;
    color: var(--gmaps-text-primary);
    margin-bottom: 4px;
}

.drop-zone-sub {
    font-size: 0.78rem;
    color: var(--gmaps-text-secondary);
}

.selected-file-badge {
    font-size: 0.82rem;
    font-weight: 600;
    color: #34a853;
    background: #e6f4ea;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 14px 0;
    text-align: center;
}

.selected-file-badge:empty {
    display: none;
}

.modal-buttons-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

/* Google Maps Directions Drawer Panel */
.gmaps-directions-drawer {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1100;
    width: 390px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    background: var(--gmaps-surface);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(60,64,67,0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--gmaps-border);
}

.directions-header {
    background: #f8f9fa;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gmaps-border);
}

.travel-modes-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.mode-pill {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--gmaps-border);
    border-radius: 20px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gmaps-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.mode-pill.active {
    background: #e8f0fe;
    color: var(--gmaps-blue);
    border-color: var(--gmaps-blue);
    font-weight: 700;
}

.mode-time {
    font-size: 0.72rem;
    font-weight: 600;
}

.close-dir-btn {
    margin-left: auto;
    width: 32px;
    height: 32px;
}

/* Directions Inputs Box */
.directions-inputs-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--gmaps-border);
    border-radius: 12px;
    padding: 10px 12px;
}

.input-pins-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.dot-origin {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--gmaps-blue);
    background: #ffffff;
}

.dots-line {
    width: 2px;
    height: 16px;
    background: repeating-linear-gradient(to bottom, var(--gmaps-border), var(--gmaps-border) 2px, transparent 2px, transparent 4px);
}

.pin-dest {
    color: var(--gmaps-red);
    font-size: 0.9rem;
}

.input-fields-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-fields-col input {
    border: none;
    outline: none;
    font-size: 0.85rem;
    color: var(--gmaps-text-primary);
    font-weight: 500;
    background: transparent;
    border-bottom: 1px solid #f1f3f4;
    padding-bottom: 2px;
}

.input-fields-col input:last-child {
    border-bottom: none;
}

/* Directions Summary Card */
.directions-summary-card {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gmaps-border);
    background: #ffffff;
}

.summary-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.meta-time {
    font-size: 1.4rem;
    font-weight: 700;
    color: #188038; /* Google green for travel time */
}

.meta-dist {
    font-size: 0.9rem;
    color: var(--gmaps-text-secondary);
    font-weight: 500;
}

.summary-route-name {
    font-size: 0.78rem;
    color: var(--gmaps-text-secondary);
    margin-bottom: 12px;
}

.directions-action-btns {
    display: flex;
    gap: 8px;
}

.nav-start-btn {
    flex: 1.4;
    justify-content: center;
    border-radius: 20px;
}

.nav-external-btn {
    flex: 1;
    justify-content: center;
    border-radius: 20px;
}

/* Turn Steps List Container */
.turn-steps-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    background: #f8f9fa;
}

.steps-header h4 {
    font-size: 0.82rem;
    color: var(--gmaps-text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.turn-steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #ffffff;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--gmaps-border);
    font-size: 0.8rem;
    line-height: 1.35;
}

.step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8f0fe;
    color: var(--gmaps-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step-text strong {
    color: var(--gmaps-text-primary);
}

.step-dist {
    font-size: 0.72rem;
    color: var(--gmaps-text-secondary);
    margin-top: 2px;
}

.hidden { display: none !important; }
    background: linear-gradient(135deg, #1a73e8, #174ea6);
    color: #ffffff;
    padding: 24px 20px 20px 20px;
    position: relative;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.gmaps-close-circle {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-category {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    opacity: 0.9;
    font-weight: 700;
}

.gmaps-place-cover h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 2px;
    margin-bottom: 6px;
}

.cover-rating-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.rating-num { font-weight: 700; }
.reviews-num { opacity: 0.85; font-size: 0.78rem; }

.gmaps-place-body {
    padding: 20px;
}

.gmaps-action-buttons-circle {
    display: flex;
    justify-content: space-around;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--gmaps-border);
    margin-bottom: 18px;
}

.gmaps-circle-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--gmaps-text-primary);
    font-size: 0.72rem;
    font-weight: 500;
}

.circle-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #ffffff;
}

.action-blue .circle-icon { background: var(--gmaps-blue); }
.action-green .circle-icon { background: var(--gmaps-green); }
.action-whatsapp .circle-icon { background: var(--gmaps-whatsapp); }
.action-gray .circle-icon { background: #5f6368; }

.gmaps-info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 0.85rem;
}

.info-icon {
    font-size: 1.1rem;
    margin-top: 2px;
}

.info-text {
    flex: 1;
    color: var(--gmaps-text-primary);
    line-height: 1.4;
}

.gmaps-hours-box, .gmaps-lead-tracker-box {
    background: #f8f9fa;
    border: 1px solid var(--gmaps-border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

.hours-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    font-size: 0.75rem;
    margin-top: 8px;
}

.tracker-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.gmaps-textarea {
    width: 100%;
    border: 1px solid var(--gmaps-border);
    border-radius: 8px;
    padding: 8px;
    font-size: 0.82rem;
}

.gmaps-btn-primary {
    background: var(--gmaps-blue);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.w-full { width: 100%; }

/* Red Google Pin Markers on Leaflet */
/* Floating Route Info Card */
.gmaps-route-card {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    width: 320px;
    background: var(--gmaps-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--gmaps-shadow-lg);
    padding: 16px;
    border: 1px solid var(--gmaps-border);
}

.route-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.route-badge {
    display: inline-block;
    background: #e8f0fe;
    color: var(--gmaps-blue);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 4px;
}

.route-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gmaps-text-primary);
}

.route-card-body {
    display: flex;
    gap: 16px;
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.route-metric {
    display: flex;
    flex-direction: column;
}

.metric-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gmaps-text-primary);
}

.metric-lbl {
    font-size: 0.72rem;
    color: var(--gmaps-text-secondary);
}

/* Hide default ugly Leaflet Routing Machine text box */
.leaflet-routing-container {
    display: none !important;
}

.hidden { display: none !important; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .gmaps-search-container {
        width: calc(100vw - 24px);
    }

    .gmaps-sidebar {
        width: 100vw;
    }
}
