:root {
    --primary-color: #2e7d32;
    /* Forest green */
    --primary-hover: #1b5e20;
    --bg-light: #f5f5f5;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    overflow: hidden;
    /* App feels like a native desktop app */
    background-color: var(--bg-light);
}

.hidden {
    display: none !important;
}

/* Map Container */
#map {
    height: 100vh;
    width: 100vw;
    z-index: 1;
}

/* Custom Marker Styling */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    padding: 16px;
    font-family: 'Outfit', sans-serif;
}

.leaflet-popup-content h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.leaflet-popup-content a {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.leaflet-popup-content a:hover {
    background-color: var(--primary-hover);
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    z-index: 1000;
}

/* Sidebar */
#sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    height: calc(100vh - 40px);
    width: 350px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 24px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.sidebar-header p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.4;
}

.filter-group {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

#places-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding: 12px;
}

#places-list li {
    padding: 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

#places-list li:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(46, 125, 50, 0.3);
    transform: translateY(-2px);
}

#places-list li.loading {
    text-align: center;
    color: var(--text-light);
    cursor: default;
    background: transparent;
}

#places-list li h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

#places-list li a {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

#places-list li a:hover {
    text-decoration: underline;
}

.sidebar-footer {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 0.8rem;
}

.sidebar-footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-footer a:hover {
    color: var(--primary-color);
}

.place-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.action-btn {
    background: transparent;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn.edit {
    color: var(--primary-color);
}

.action-btn.edit:hover {
    text-decoration: underline;
}

.action-btn.delete {
    color: #d32f2f;
}

.action-btn.delete:hover {
    text-decoration: underline;
}

#toggle-admin-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--glass-bg);
    border: 1px solid #ddd;
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#toggle-admin-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Admin Panel */
#admin-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 380px;
    border-radius: 16px;
    padding: 24px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    transition: var(--transition);
    opacity: 1;
    transform: translateX(0);
}

#admin-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
}

#admin-panel h2 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

#admin-panel h3 {
    font-size: 1.2rem;
    margin-top: 24px;
    margin-bottom: 12px;
}

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

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.input-group input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.input-group input[readonly] {
    background-color: rgba(0, 0, 0, 0.05);
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    flex: 1;
}

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

.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn.secondary:hover {
    background-color: rgba(46, 125, 50, 0.1);
}

hr {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}

.instruction {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 16px;
    padding: 8px;
    background: rgba(46, 125, 50, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.message {
    margin-top: 12px;
    font-size: 0.85rem;
    min-height: 20px;
}

.message.error {
    color: #d32f2f;
}

.message.success {
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        height: 40vh;
        top: auto;
        bottom: 0px;
        left: 0px;
        border-radius: 24px 24px 0 0;
        z-index: 1001;
        /* Above map controls */
    }

    #admin-panel {
        width: calc(100% - 40px);
        top: 20px;
        left: 20px;
        z-index: 1002;
    }

    #toggle-admin-btn {
        top: 20px;
        right: 20px;
        bottom: auto;
    }
}