/* ===========================================
   MİNİBÜSÜM NEREDE? - CSS
   İzmir Büyükşehir Belediyesi
   =========================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #eef2f7;
    min-height: 100vh;
    color: #1a1a2e;
}

/* ===== HEADER ===== */
.main-header {
    background: #fff;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    height: 50px;
}

.header-divider {
    width: 2px;
    height: 40px;
    background: #d0d5dd;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: #1a73e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.header-brand .brand-text {
    font-size: 18px;
    font-weight: 700;
    color: #1a73e8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-brand .brand-text span {
    border-bottom: 3px dotted #1a73e8;
    padding-bottom: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #555;
    transition: all 0.2s;
}

.theme-btn:hover {
    background: #f5f5f5;
}

.theme-btn.active {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

/* ===== MAIN LAYOUT ===== */
.main-container {
    display: flex;
    height: calc(100vh - 74px);
    overflow: hidden;
}

/* ===== LEFT PANEL ===== */
.left-panel {
    width: 480px;
    min-width: 480px;
    background: #eef2f7;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.panel-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===== PANEL LOADING ===== */
.panel-loading {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 10;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

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

.panel-loading-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #e3e8ef;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: panel-spin 0.8s linear infinite;
}

@keyframes panel-spin {
    to { transform: rotate(360deg); }
}

body.dark-mode .panel-loading {
    background: rgba(30,33,48,0.85);
    color: #cbd2e0;
}

body.dark-mode .panel-loading-spinner {
    border-color: #3a3f55;
    border-top-color: #4a90e2;
}

.panel-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
}

/* ===== FORM CONTROLS ===== */
.form-group {
    margin-bottom: 14px;
}

.custom-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.custom-select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.search-input-group {
    position: relative;
    margin-bottom: 16px;
}

.search-input-group input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s;
}

.search-input-group input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.search-input-group .search-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 40px;
    border: none;
    background: transparent;
    color: #1a73e8;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.search-input-group .search-btn:hover {
    background: rgba(26,115,232,0.08);
}

/* ===== PLANNER ===== */
.planner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.planner-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.planner-close:hover {
    background: #fee;
    color: #e74c3c;
}

.planner-input-group {
    display: flex;
    gap: 6px;
}

.planner-input-group input {
    flex: 1;
    font-size: 13px;
    padding: 8px 12px;
}

.planner-pick-btn {
    width: 38px;
    height: 38px;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #1a73e8;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.planner-pick-btn:hover {
    background: #e8f0fe;
}

.planner-plan-btn {
    width: 100%;
    padding: 10px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

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

.planner-results-list {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.planner-result-item {
    padding: 8px 10px;
    border: 1.5px solid #e0e5ec;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.planner-result-item:hover {
    border-color: #1a73e8;
    background: #f0f7ff;
}

.planner-result-item.active {
    border-color: #1a73e8;
    background: #e8f0fe;
}

.planner-result-item .pr-hat {
    font-size: 13px;
    color: #333;
}

.planner-result-item .pr-hat strong {
    color: #1a73e8;
}

.planner-result-item .pr-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
}

.planner-result-item .pr-steps .pr-walk {
    color: #e74c3c;
}

.planner-result-item .pr-steps .pr-ride {
    color: #1a73e8;
}

body.dark-mode .planner-pick-btn {
    background: #0f3460;
    border-color: #1a4a7a;
    color: #6db3f2;
}

body.dark-mode .planner-result-item {
    border-color: #1a4a7a;
}

body.dark-mode .planner-result-item:hover,
body.dark-mode .planner-result-item.active {
    background: #0f3460;
}

body.dark-mode .planner-result-item .pr-hat {
    color: #ccc;
}

/* ===== SEARCH RESULTS ===== */
.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #d0d5dd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #e8f0fe;
}

.search-result-item .result-hat {
    font-weight: 600;
    font-size: 13px;
    color: #1a73e8;
}

.search-result-item .result-desc {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-results .no-result {
    padding: 14px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

body.dark-mode .search-results {
    background: #16213e;
    border-color: #1a4a7a;
}

body.dark-mode .search-result-item {
    border-bottom-color: #1a4a7a;
}

body.dark-mode .search-result-item:hover {
    background: #0f3460;
}

body.dark-mode .search-result-item .result-desc {
    color: #aaa;
}

body.dark-mode .search-results .no-result {
    color: #777;
}

/* ===== TABS ===== */
.tab-group {
    display: flex;
    margin-bottom: 20px;
    gap: 0;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #1a73e8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(26,115,232,0.3);
}

.tab-btn:not(.active):hover {
    background: #f0f4f8;
    color: #1a73e8;
}

/* ===== TAB CONTENT ===== */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

/* ===== SCHEDULE TABLE ===== */
.schedule-container {
    display: flex;
    gap: 12px;
}

.schedule-column {
    flex: 1;
}

.schedule-header {
    text-align: center;
    padding: 10px;
    border: 2px solid #1a73e8;
    border-radius: 10px;
    margin-bottom: 8px;
}

.schedule-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1a73e8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.schedule-list {
    list-style: none;
}

.schedule-list li {
    text-align: center;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.schedule-list li:last-child {
    border-bottom: none;
}

/* ===== FARE TABLE ===== */
.fare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e5ec;
}

.fare-table thead th {
    background: #1a73e8;
    color: #fff;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.fare-table tbody td {
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.fare-table tbody tr:last-child td {
    border-bottom: none;
}

.fare-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

/* ===== ROUTE INFO ===== */
.route-info {
    padding: 16px 0;
}

.route-info .route-description {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #1a73e8;
}

.route-stops {
    margin-top: 12px;
}

.route-stops .stop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 13px;
    color: #444;
}

.route-stops .stop-item .stop-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a73e8;
    flex-shrink: 0;
}

.route-stops .stop-item:first-child .stop-dot {
    background: #34a853;
}

.route-stops .stop-item:last-child .stop-dot {
    background: #ea4335;
}

.route-stops .stop-item .stop-arrow {
    margin-left: auto;
    color: #1a73e8;
    font-size: 11px;
    opacity: 0.6;
    flex-shrink: 0;
}

/* ===== MAP PANEL ===== */
.map-panel {
    flex: 1;
    position: relative;
}

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

.map-legend {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #fff;
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    z-index: 1000;
    font-size: 13px;
    max-width: 420px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid;
}

.legend-dot.start {
    border-color: #34a853;
    background: rgba(52,168,83,0.2);
}

.legend-dot.end {
    border-color: #ea4335;
    background: rgba(234,67,53,0.2);
}

/* ===== MAP CONTROLS ===== */
.map-controls {
    position: absolute;
    top: 80px;
    left: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    transition: all 0.2s;
}

.map-control-btn:hover {
    background: #f0f0f0;
}

.map-control-btn.active {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

/* ===== JOURNEY MARKERS (BİN/İN) ===== */
.journey-marker {
    text-align: center;
    background: none !important;
    border: none !important;
}

.journey-marker .jm-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.journey-marker .jm-icon.board {
    background: #1a73e8;
}

.journey-marker .jm-icon.alight {
    background: #e74c3c;
}

.journey-marker .jm-label {
    font-size: 11px;
    font-weight: 700;
    color: #333;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff;
    margin-top: 2px;
}

.intersection-tooltip {
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.intersection-tooltip::before {
    border-top-color: #1a73e8;
}

.legend-info {
    width: 100%;
    font-size: 11px;
    color: #888;
    font-style: italic;
    margin-top: 4px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d0d5dd;
}

.empty-state p {
    font-size: 14px;
}

/* ===== SUBROUTE SELECTOR ===== */
.subroute-group {
    margin-bottom: 16px;
}

.subroute-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    font-size: 13px;
    color: #333;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.subroute-select:focus {
    outline: none;
    border-color: #1a73e8;
}

/* ===== DARK MODE ===== */
body.dark-mode {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .main-header {
    background: #16213e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .left-panel {
    background: #1a1a2e;
}

body.dark-mode .panel-card {
    background: #16213e;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

body.dark-mode .panel-title {
    color: #e0e0e0;
}

body.dark-mode .custom-select,
body.dark-mode .search-input-group input,
body.dark-mode .subroute-select {
    background: #0f3460;
    border-color: #1a4a7a;
    color: #e0e0e0;
}

body.dark-mode .schedule-list li {
    color: #ccc;
    border-bottom-color: #1a4a7a;
}

body.dark-mode .fare-table tbody td {
    color: #ccc;
    border-bottom-color: #1a4a7a;
}

body.dark-mode .fare-table tbody tr:nth-child(even) {
    background: #0f3460;
}

body.dark-mode .route-info .route-description {
    background: #0f3460;
    color: #ccc;
}

body.dark-mode .map-legend {
    background: #16213e;
    color: #e0e0e0;
}

body.dark-mode .tab-btn:not(.active) {
    color: #aaa;
}

body.dark-mode .tab-btn:not(.active):hover {
    background: #0f3460;
    color: #1a73e8;
}

body.dark-mode .header-divider {
    background: #1a4a7a;
}

body.dark-mode .theme-btn {
    border-color: #1a4a7a;
    background: #16213e;
    color: #ccc;
}

body.dark-mode .theme-btn:hover {
    background: #0f3460;
}

/* ===== NO DATA MESSAGE ===== */
.no-data-msg {
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* ===== SCROLLBAR ===== */
.left-panel::-webkit-scrollbar,
.tab-content::-webkit-scrollbar {
    width: 6px;
}

.left-panel::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track {
    background: transparent;
}

.left-panel::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 3px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 74px);
        overflow: auto;
    }

    .left-panel {
        width: 100%;
        min-width: unset;
        max-height: none;
        overflow-y: visible;
    }

    .map-panel {
        height: 50vh;
        min-height: 50vh;
    }

    #map {
        height: 100%;
        min-height: 50vh;
    }

    .map-legend {
        flex-wrap: wrap;
        right: 8px;
        top: 8px;
        gap: 8px;
        font-size: 11px;
        padding: 8px 12px;
    }

    .main-header {
        padding: 10px 16px;
    }

    .header-brand .brand-text {
        font-size: 14px;
    }

    .header-logo {
        height: 36px;
    }
}
