@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Light theme variables */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --hover: #f1f5f9;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --pin-visited: #1c1917;
    --pin-to-visit: #78716c;
}

        [data-theme="dark"] {
            --primary: #60a5fa;
            --primary-dark: #93c5fd;
            --background: #000000;
            --surface: #0a0a0a;
            --surface-secondary: #141414;
            --text: #f1f5f9;
            --text-secondary: #cbd5e1;
            --border: #1e1e1e;
            --hover: #1e1e1e;
            --danger: #ef4444;
            --danger-dark: #dc2626;
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
            --pin-visited: #f1f5f9;
            --pin-to-visit: #cbd5e1;
        }* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            height: 100vh;
            display: flex;
            flex-direction: column;
            background: var(--background);
            color: var(--text);
            overflow: hidden;
        }

        header {
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            padding: 1rem 2rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: relative;
            z-index: 10;
        }

        .header-title {
            font-size: 1rem;
            font-weight: 500;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 0.5rem;
            border-radius: 0.5rem;
            transition: all 0.2s ease;
        }

        .header-title:hover {
            background: var(--hover);
            color: var(--text);
        }

        .header-title[contenteditable="true"] {
            outline: none;
            background: var(--hover);
            color: var(--text);
        }

        .container {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        #map {
            flex: 1;
            border-right: 1px solid var(--border);
            z-index: 1;
            position: relative;
        }

        [data-theme="dark"] #map::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.25);
            pointer-events: none;
            z-index: 401;
        }

        .sidebar {
            width: 380px;
            background: var(--surface);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
        }

        .view-toggle {
            display: flex;
            gap: 0.25rem;
            padding: 1rem 1.5rem 0;
            border-bottom: 1px solid var(--border);
        }

        .view-tab {
            flex: 1;
            padding: 0.625rem;
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
            border-radius: 6px 6px 0 0;
            transition: all 0.2s;
            text-align: center;
        }

        .view-tab:hover {
            background: var(--hover);
            color: var(--text);
        }

        .view-tab.active {
            background: var(--primary);
            color: var(--surface);
            font-weight: 500;
        }

        .sidebar-header {
            padding: 2rem 1.5rem 1rem;
            border-bottom: 1px solid var(--border);
        }

        .sidebar-header.search-view {
            padding-bottom: 1.5rem;
        }

        .editable-heading {
            font-size: 1.5rem;
            font-weight: 300;
            margin-bottom: 1.5rem;
            color: var(--text);
            cursor: text;
            padding: 0.25rem;
            border-radius: 4px;
            transition: background 0.2s;
        }

        .editable-heading:hover {
            background: var(--hover);
        }

        .editable-heading[contenteditable="true"] {
            outline: none;
            background: var(--hover);
        }

        .search-box {
            margin-bottom: 1rem;
            position: relative;
        }

        .search-box input {
            width: 100%;
            padding: 0.625rem 0.875rem;
            border: 2px solid var(--border);
            border-radius: 0.5rem;
            font-size: 0.875rem;
            background: var(--surface);
            transition: all 0.2s;
            font-family: inherit;
            font-weight: 600;
            color: var(--text);
        }

        .search-box input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .search-box input::placeholder {
            color: var(--text-secondary);
        }

        .place-search-box {
            position: relative;
        }

        .place-search-box input {
            width: 100%;
            padding: 0.625rem 0.875rem;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 0.875rem;
            background: var(--surface);
            transition: all 0.2s;
            font-family: inherit;
            font-weight: 600;
            color: var(--text);
        }

        .place-search-box input:focus {
            outline: none;
            border-color: var(--primary);
            background: var(--surface);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .place-search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            margin-top: 0.5rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            box-shadow: var(--shadow-md);
            max-height: 400px;
            overflow-y: auto;
            display: none;
            z-index: 100;
        }

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

        .place-result-item {
            padding: 0.875rem 1rem;
            cursor: pointer;
            border-bottom: 1px solid var(--border);
            transition: all 0.2s;
        }

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

        .place-result-item:hover {
            background: var(--hover);
        }

        .place-result-name {
            font-weight: 500;
            font-size: 0.875rem;
            color: var(--text);
            margin-bottom: 0.25rem;
        }

        .place-result-address {
            font-size: 0.75rem;
            color: var(--text-secondary);
            font-weight: 300;
        }

        .map-search-container {
            position: absolute;
            top: 1rem;
            left: 1rem;
            right: 1rem;
            z-index: 1000;
            display: flex;
            gap: 0.5rem;
            pointer-events: none;
        }

        .map-search-box {
            flex: 1;
            position: relative;
            pointer-events: auto;
        }

        .map-search-box input {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid #e7e5e4;
            border-radius: 8px;
            font-size: 0.875rem;
            background: #ffffff;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            transition: all 0.2s;
            font-family: inherit;
            font-weight: 400;
        }

        .map-search-box input:focus {
            outline: none;
            border-color: #1c1917;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .map-search-box input::placeholder {
            color: #a8a29e;
        }

        .search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            margin-top: 0.5rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: var(--shadow-md);
            max-height: 300px;
            overflow-y: auto;
            display: none;
        }

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

        .search-result-item {
            padding: 0.875rem 1rem;
            cursor: pointer;
            border-bottom: 1px solid #f5f5f4;
            transition: background 0.2s;
        }

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

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

        .search-result-name {
            font-weight: 500;
            font-size: 0.875rem;
            color: #1c1917;
            margin-bottom: 0.25rem;
        }

        .search-result-address {
            font-size: 0.75rem;
            color: #78716c;
            font-weight: 300;
        }

        .pin-categories {
            display: flex;
            gap: 0.5rem;
        }

        .pin-btn {
            flex: 1;
            padding: 0.75rem 1rem;
            border: 2px solid var(--border);
            background: var(--surface);
            border-radius: 0.5rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--text);
            transition: all 0.2s;
            letter-spacing: 0.01em;
            box-shadow: var(--shadow-sm);
        }

        .pin-btn:hover {
            border-color: var(--primary);
            background: var(--hover);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
            color: var(--text);
        }

        [data-theme="dark"] .pin-btn {
            background: var(--surface-secondary);
        }

        .pin-btn.active {
            background: var(--primary);
            border-color: var(--primary);
            color: var(--surface);
        }

        .pin-color {
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }

        .visited .pin-color {
            background: #1c1917;
        }

        .plan-to-visit .pin-color {
            background: #2563eb;
        }

        .tabs-section {
            padding: 1rem 1.5rem 0.75rem;
            border-bottom: 1px solid var(--border);
        }

        .tabs-container {
            display: flex;
            gap: 0.25rem;
            overflow-x: auto;
            scrollbar-width: none;
        }

        .tabs-container::-webkit-scrollbar {
            display: none;
        }

        .tab {
            padding: 0.5rem 0.75rem;
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 400;
            color: var(--text-secondary);
            border-radius: 4px;
            transition: all 0.2s;
            white-space: nowrap;
            position: relative;
        }

        .tab:hover {
            background: var(--hover);
            color: var(--text);
        }

        .tab.active {
            background: var(--primary);
            color: var(--surface);
        }

        .tab .delete-tab {
            margin-left: 0.5rem;
            opacity: 0;
            transition: opacity 0.2s;
        }

        .tab:hover .delete-tab {
            opacity: 1;
        }

        .add-tab-btn {
            padding: 0.5rem 0.75rem;
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 0.875rem;
            color: #a8a29e;
            border-radius: 4px;
            transition: all 0.2s;
            min-width: 32px;
        }

        .add-tab-btn:hover {
            background: #fafaf9;
            color: #1c1917;
        }

        .locations-list {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 1.5rem;
        }

        .locations-list::-webkit-scrollbar {
            width: 6px;
        }

        .locations-list::-webkit-scrollbar-track {
            background: transparent;
        }

        .locations-list::-webkit-scrollbar-thumb {
            background: #e7e5e4;
            border-radius: 3px;
        }

        .location-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 1rem;
            padding: 1.25rem;
            margin-bottom: 1rem;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: var(--shadow-sm);
        }

        .location-card:hover {
            border-color: var(--primary);
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
        }

        [data-theme="dark"] .location-card:hover {
            background: var(--surface);
            border-color: var(--primary);
            transform: translateY(-2px) scale(1.02);
        }

        [data-theme="dark"] .location-card {
            background: var(--surface-secondary);
        }

        .location-header {
            display: flex;
            justify-content: space-between;
            align-items: start;
            margin-bottom: 0.5rem;
        }

        .location-name {
            font-weight: 600;
            font-size: 1rem;
            color: var(--text);
            margin-bottom: 0.25rem;
        }

        .rating {
            color: var(--text-secondary);
            font-size: 0.875rem;
            font-weight: 300;
        }

        .location-notes {
            color: var(--text-secondary);
            font-size: 0.875rem;
            font-weight: 300;
            margin: 0.75rem 0;
            line-height: 1.6;
        }

        .location-image {
            width: 100%;
            height: 140px;
            object-fit: cover;
            border-radius: 6px;
            margin-top: 0.75rem;
            opacity: 0.9;
        }

        .clear-btn {
            margin: 0 1.5rem 1.5rem;
            padding: 0.625rem;
            background: transparent;
            color: #78716c;
            border: 1px solid #e7e5e4;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 400;
            font-size: 0.75rem;
            transition: all 0.2s;
        }

        .clear-btn:hover {
            background: #fafaf9;
            border-color: #d6d3d1;
            color: #1c1917;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(15, 23, 42, 0.6);
            backdrop-filter: blur(8px);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: var(--surface);
            border-radius: 1rem;
            padding: 2rem;
            width: 90%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: var(--shadow-lg);
            animation: slideUp 0.3s ease;
        }

        [data-theme="dark"] .modal-content {
            border: 1px solid var(--border);
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal-header {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 2rem;
            color: var(--text);
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: var(--text);
            font-size: 0.875rem;
            letter-spacing: 0.01em;
        }

        .form-group input[type="text"],
        .form-group textarea,
        .form-group select {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 2px solid var(--border);
            border-radius: 0.5rem;
            font-size: 0.9375rem;
            font-family: inherit;
            transition: all 0.2s;
            background: var(--surface);
            color: var(--text);
            font-weight: 400;
        }

        .form-group input[type="text"]:focus,
        .form-group textarea:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .form-group textarea {
            resize: vertical;
            min-height: 80px;
            line-height: 1.5;
        }

        .star-rating {
            display: flex;
            gap: 0.25rem;
            font-size: 1.5rem;
        }

        .star {
            cursor: pointer;
            color: var(--border);
            transition: all 0.2s ease;
            font-size: 1.25rem;
        }

        .star:hover {
            transform: scale(1.1);
        }

        .star.active,
        .star:hover {
            color: var(--primary);
            text-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
        }

        [data-theme="dark"] .star.active,
        [data-theme="dark"] .star:hover {
            text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
        }

        .image-upload {
            border: 2px dashed var(--border);
            border-radius: 0.75rem;
            padding: 2rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            background: var(--background);
        }

        .image-upload:hover {
            border-color: var(--primary);
            background: var(--hover);
        }

        .image-upload p {
            color: var(--text-secondary);
            font-weight: 400;
            font-size: 0.875rem;
        }

        .image-preview {
            max-width: 100%;
            max-height: 200px;
            border-radius: 8px;
            margin-top: 1rem;
        }

        .modal-actions {
            display: flex;
            gap: 0.75rem;
            margin-top: 1.5rem;
        }

        .modal-actions button {
            flex: 1;
            padding: 0.75rem;
            border: 1px solid #e7e5e4;
            border-radius: 6px;
            font-size: 0.875rem;
            font-weight: 400;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-primary {
            background: var(--primary);
            color: var(--surface);
            border-color: var(--primary);
        }

        .btn-primary:hover {
            background: var(--primary-dark);
            border-color: var(--primary-dark);
        }

        .btn-secondary {
            background: transparent;
            color: #78716c;
        }

        .btn-secondary:hover {
            background: #fafaf9;
        }

        .btn-danger {
            background: #dc2626;
            color: #ffffff;
            border-color: #dc2626;
        }

        .btn-danger:hover {
            background: #b91c1c;
            border-color: #b91c1c;
        }

        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            color: var(--text-secondary);
        }

        .empty-state svg {
            width: 64px;
            height: 64px;
            margin-bottom: 1.5rem;
            opacity: 0.4;
            stroke: var(--text-secondary);
        }

        .empty-state p {
            font-size: 1rem;
            font-weight: 400;
            color: var(--text);
        }

        .leaflet-container {
            background: var(--background) !important;
        }

        [data-theme="dark"] .leaflet-tile {
            filter: brightness(0.85) contrast(1.1) !important;
        }

        .leaflet-bottom.leaflet-right {
            bottom: 1rem;
            right: 1rem;
        }

        .leaflet-control-zoom {
            border: 2px solid var(--border) !important;
            border-radius: 0.5rem !important;
            overflow: hidden;
            box-shadow: var(--shadow-sm) !important;
        }

        .leaflet-control-zoom a {
            background: var(--surface) !important;
            color: var(--text) !important;
            border: none !important;
            width: 36px !important;
            height: 36px !important;
            line-height: 36px !important;
            font-size: 1.25rem !important;
        }

        .leaflet-control-zoom a:hover {
            background: var(--hover) !important;
        }

/* Theme Toggle Styles */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: var(--text);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--hover);
}

.theme-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
}

[data-theme="dark"] .sun-icon,
[data-theme="light"] .moon-icon {
    display: none;
}

[data-theme="dark"] .moon-icon,
[data-theme="light"] .sun-icon {
    display: block;
}

/* Add smooth transition for theme changes */
body * {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}