/* Standard Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    /* Üst giriş çubuğu (tek satır) + küçük boşluk — sağ panel / mobil üst ofset */
    --app-top-ui-offset: 68px;
    --app-side-margin: 20px;
}

body {
    height: 100vh;
    overflow: hidden;
    background-color: #f8f9fa;
}

.top-auth-menu {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 1000;
    background: white;
    padding: 8px 14px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px 10px;
    max-width: calc(100vw - 40px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.top-auth-menu > * {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Sidebar and Content containers */
#sidebar-container {
    position: absolute;
    top: var(--app-top-ui-offset);
    left: 20px;
    height: calc(100% - var(--app-top-ui-offset) - 20px);
    z-index: 10;
}

#content-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Sidebar Styling */
#sidebar {
    width: 320px;
    height: 100%;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#sidebar h2 {
    color: #333;
    margin-bottom: 5px;
}

#sidebar small {
    display: block;
    color: #777;
    margin-bottom: 20px;
}

/* Profil: tagline ile ilk ayraç arası (#sidebar small 20px margin burada iptal) */
#sidebar.profile-sidebar small {
    margin-bottom: 0;
}

#sidebar.profile-sidebar > hr:first-of-type {
    margin: 0 0 10px;
    border: none;
    border-top: 1px solid #dee2e6;
}

/* Profil: başlığa tıklanınca açılan paneller */
.profile-accordion {
    border: 1px solid #eef0f2;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fafbfc;
    overflow: hidden;
}

.profile-accordion-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.profile-accordion-summary::-webkit-details-marker {
    display: none;
}

.profile-accordion-summary::after {
    content: '▾';
    font-size: 0.75rem;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.profile-accordion[open] > .profile-accordion-summary::after {
    transform: rotate(-180deg);
}

.profile-accordion-body {
    padding: 0 14px 14px;
    border-top: 1px solid #eef0f2;
    background: #fff;
}

.profile-settings-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
}

.profile-settings-hint {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.45;
    margin: 0 0 14px;
}

.profile-membership-summary {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
    margin-bottom: 4px;
}

.profile-membership-line {
    margin: 6px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: baseline;
}

.profile-membership-label {
    color: #868e96;
    font-weight: 600;
    min-width: 8.5rem;
}

.profile-settings-hr {
    border: none;
    border-top: 1px solid #eef0f2;
    margin: 16px 0;
}

.profile-form-group {
    margin-bottom: 12px;
}

.profile-msg {
    font-size: 0.85rem;
    margin: 10px 0 0;
    min-height: 1.2em;
}

.profile-msg--ok {
    color: #198754;
    font-weight: 600;
}

.profile-msg--err {
    color: #dc3545;
    font-weight: 600;
}

.profile-route-placeholder {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0;
    padding-top: 4px;
}

.profile-route-intro {
    color: #6c757d;
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0 0 12px;
}

.profile-route-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    outline: none;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.profile-route-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.profile-route-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
}

.profile-route-btn--primary {
    background: #0d9488;
    color: #fff;
}

.profile-route-btn--primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.profile-route-btn--secondary {
    background: #17a2b8;
    color: #fff;
}

.profile-route-msg {
    font-size: 0.85rem;
    margin: 10px 0 0;
    min-height: 1.2em;
    white-space: normal;
    word-break: break-word;
}

.profile-route-msg--ok {
    color: #198754;
    font-weight: 600;
}

.profile-route-msg--err {
    color: #dc3545;
    font-weight: 600;
}

.profile-route-msg--info {
    color: #0c5460;
    font-weight: 600;
}

.profile-route-summary-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 16px 0 8px;
}

.profile-route-summary {
    font-size: 0.88rem;
    color: #495057;
    line-height: 1.55;
}

.profile-route-summary ul {
    margin: 0;
    padding-left: 1.1rem;
}

.profile-route-summary li {
    margin: 6px 0;
}

.fav-category-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 2px solid #eef0f2;
    background: #fff;
    max-height: 200px;
    overflow-y: auto;
}

.fav-category-checkboxes label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.fav-category-checkboxes input[type='checkbox'] {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    cursor: pointer;
}

.fav-places-panel {
    margin-top: 6px;
    margin-bottom: 4px;
}

.fav-places-panel-body {
    padding-top: 8px !important;
}

.fav-place-list-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 2px solid #eef0f2;
    background-color: #fff;
    font-size: 0.92rem;
    outline: none;
    box-sizing: border-box;
}

.profile-route-start-pin {
    width: 26px;
    height: 26px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: #0d9488;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Form groups and labels */
.city-select-group {
    margin-bottom: 20px;
}

.city-label {
    display: block;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 5px;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
    background-color: white;
}

/* Buttons */
.btn {
    text-decoration: none;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: inline-block;
    transition: background 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #28a745;
    color: white;
}

.btn-secondary:hover {
    background-color: #218838;
}

/* Horizontal line and dynamic content */
hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* Keşif sol menü: tek ayraç + başlık aralığı (çift hr ve ~20px margin yerine ~yarı) */
#sidebar > hr {
    margin: 10px 0;
}

#dynamic-title {
    color: #333;
    margin-bottom: 10px;
}

#sidebar:not(.profile-sidebar) #dynamic-title {
    margin-top: 5px;
}

#dynamic-content p {
    color: #666;
    font-size: 0.9rem;
}

/* Map, Popups, Markers */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.marker {
    width: 20px;
    height: 20px;
    background-color: #FF0000;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.marker:hover, .marker.selected {
    transform: scale(1.3);
    background-color: #007bff;
}

/* Right Sidebar Styling */
#right-sidebar {
    position: absolute;
    top: var(--app-top-ui-offset);
    right: -340px;
    width: 300px;
    max-width: min(92vw, 340px);
    height: calc(100vh - var(--app-top-ui-offset) - var(--app-side-margin));
    background-color: white;
    box-shadow: -10px 10px 30px rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    z-index: 900;
    transition: right 0.35s ease;
    overflow: hidden;
}

#right-sidebar.open {
    right: var(--app-side-margin);
}

#right-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    margin-top: 4px;
}

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

.close-right-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #777;
}

.artifact-btn {
    width: 100%;
    background-color: #eee;
    border: none;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.3s;
}

.artifact-btn:hover {
    background-color: #ddd;
}

/* Details button in dynamic content area */
.details-btn {
    width: 100%;
    padding: 10px;
    background-color: #eee;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: background 0.3s;
}

.details-btn:hover {
    background-color: #ddd;
}

.details-btn.favorite {
    background-color: #ffc107;
    color: #333;
}

.details-btn.favorite:hover {
    background-color: #e0a800;
}

/* Modals */
.tripolog-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tripolog-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: white;
    width: 450px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
}

#modal-artifact-desc {
    white-space: pre-wrap;
    line-height: 1.55;
    color: #444;
    margin-top: 12px;
    font-size: 0.95rem;
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #777;
}

/* ===== YÖNETİM PANELİ (ADMIN) DÜZELTMELERİ ===== */

.admin-content { 
    width: 100%;
    max-width: 944px;
    margin: 28px auto 44px;
    padding: 0 22px;
    overflow: visible;
    background: #f8f9fa; 
    height: auto;
    min-height: calc(100vh - 92px);
}

.form-card { 
    background: white; 
    padding: 19px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    margin-bottom: 18px; 
    border: 1px solid #eee;
}

.form-group { 
    margin-bottom: 16px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 6px; 
    font-weight: 600; 
    color: #333; 
    font-size: 0.95rem;
}

.form-group input, .form-group textarea { 
    width: 100%; 
    padding: 10px 12px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    outline: none; 
    transition: all 0.3s; 
    font-size: 1rem; 
    background-color: #fff;
}

.form-group input:focus, .form-group textarea:focus { 
    border-color: #007bff; 
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1); 
}

.admin-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 16px; 
}

/* Yer yonetimi: ulke + sehir + kategori tek satir */
.admin-grid.admin-grid-place-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-list { 
    list-style: none; 
    padding: 0; 
    margin-top: 15px; 
    border-top: 1px solid #eee; 
    padding-top: 15px; 
}

.admin-list li { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #f8f9fa; 
    padding: 10px 15px; 
    border-radius: 8px; 
    margin-bottom: 8px; 
    border: 1px solid #eee; 
}

.admin-list span { 
    font-weight: 600; 
    color: #333; 
}

.del-btn { 
    background: #dc3545; 
    color: white; 
    border: none; 
    padding: 5px 10px; 
    border-radius: 5px; 
    cursor: pointer; 
    font-size: 0.85rem; 
}

.admin-layout {
    width: 100%;
    max-width: 1220px;
    margin: 20px auto 36px;
    padding: 0 18px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 18px;
    align-items: start;
}

.admin-nav {
    position: sticky;
    top: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.admin-nav h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #333;
}

.admin-nav-btn {
    width: 100%;
    text-align: left;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: #44515d;
    padding: 8px 6px;
    border-radius: 0;
    margin-bottom: 2px;
    cursor: pointer;
    font-weight: 600;
}

.admin-nav-btn.active {
    color: #007bff;
    border-left-color: #007bff;
    background: rgba(0,123,255,0.06);
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #eceff3;
    padding: 8px 6px;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    font-weight: 700;
    color: #4b5864;
}

.admin-table td .btn,
.admin-table td .del-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
}

/* Tablo islem sutunu: Duzenle / Sil yan yana, hizali */
.admin-table .admin-row-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    vertical-align: middle;
}

.admin-table .admin-row-actions .btn,
.admin-table .admin-row-actions .del-btn {
    flex: 0 0 auto;
    margin: 0;
    min-width: 5.5rem;
    box-sizing: border-box;
}

.place-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.place-search-input {
    width: 260px;
    margin: 0 auto;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.place-toolbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rs-config-hint {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.45;
    margin-bottom: 16px;
}

.rs-config-hint code {
    font-size: 0.85em;
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
}

.rs-config-table textarea.rs-item-modal-body {
    min-height: 72px;
    width: 100%;
    max-width: 420px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    resize: vertical;
}

.rs-config-table input[type="text"] {
    min-width: 0;
    width: 100%;
    max-width: 200px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Responsive / Mobil Ayarları */
@media (max-width: 1100px) { 
    .admin-grid { grid-template-columns: 1fr; }
    .admin-grid.admin-grid-place-filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
        max-width: 100%;
        margin: 16px auto 28px;
        padding: 0 14px;
    }
    .admin-nav {
        position: static;
    }
    .admin-content {
        max-width: 100%;
        margin: 0;
        padding: 0;
        min-height: auto;
    }
    #sidebar-container { top: auto; bottom: 0; left: 0; width: 100%; height: 45%; z-index: 10; }
    #sidebar { width: 100%; height: 100%; border-radius: 20px 20px 0 0; }
    #right-sidebar {
        width: 100%;
        max-width: 100%;
        right: -100%;
        border-radius: 12px 12px 0 0;
        top: var(--app-top-ui-offset);
        height: calc(100vh - var(--app-top-ui-offset));
        max-height: calc(100vh - var(--app-top-ui-offset));
        z-index: 1100;
    }
    #right-sidebar.open { right: 0; }
}

.admin-page {
    overflow-y: auto;
    height: auto;
}