/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #1976d2;
    --primary-dark: #115293;
    --primary-light: #4791db;
    --secondary-color: #dc004e;
    --background: #f5f5f5;
    --surface: #ffffff;
    --surface-variant: #f8f9fa;
    --border-color: #e0e0e0;
    --text-primary: #212121;
    --text-secondary: #757575;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.12);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.15);
    
    /* Panel Widths */
    --left-panel-width: 360px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: var(--background);
    overflow: hidden;
}

/* ===== Hero Banner ===== */
.hero-banner {
    background: rgba(25, 118, 210, 0.08);
    color: #000;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-height: 106px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    width: 100%;
}

.hero-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.2;
    color: var(--text-primary);
}

.hero-description {
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.8;
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* Right Container */
.right-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Main content area (map + detail) */
.map-detail-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ===== Center Panel (Map) ===== */
.center-panel {
    flex: 1;
    position: relative;
    transition: flex 0.3s ease;
}

.center-panel.with-detail {
    flex: 1;
}

/* ===== Right Panel (Detail) ===== */
.right-panel {
    width: 0;
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease;
}

.right-panel.visible {
    flex: 1;
    width: auto;
    flex-shrink: 0;
}

/* ===== Left Panel ===== */
.left-panel {
    width: var(--left-panel-width);
    background: var(--surface-variant);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* App Download Banner */
.app-download-banner {
    padding: 16px;
    background: rgba(25, 118, 210, 0.08);
    border-bottom: 1px solid var(--border-color);
    min-height: 106px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.banner-title {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.download-buttons {
    display: flex;
    gap: 8px;
}

.download-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #000;
    border: 1px solid #fff;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.download-btn:hover {
    transform: translateY(-1px);
}

.store-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 13px;
}

.ios-icon {
    background: linear-gradient(135deg, #64b5f6 0%, #1976d2 100%);
    color: #fff;
    font-size: 16px;
}

.play-icon {
    background: linear-gradient(135deg, #42a5f5 0%, #0277bd 100%);
    color: #fff;
    font-size: 14px;
}

.store-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.store-label {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
}

.store-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-top: 2px;
    line-height: 1;
}

/* Panel Header */
.panel-header {
    padding: 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
}

.app-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 4px;
}

.lang-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-icon {
    width: 24px;
    height: 16px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
}

.lang-btn:hover {
    background: var(--surface-variant);
}

.lang-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Mode Selector */
.mode-selector {
    padding: 12px;
    display: flex;
    gap: 8px;
    background: var(--surface);
}

.mode-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.mode-btn:hover {
    background: var(--surface-variant);
}

.mode-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.mode-btn svg {
    width: 20px;
    height: 20px;
}

.mode-label {
    font-size: 11px;
    font-weight: 500;
}

/* Search Section */
.search-section {
    padding: 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    margin-bottom: 8px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 36px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-input:focus {
    border-color: var(--primary-color);
}

.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: var(--text-secondary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.city-filter {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--surface);
    cursor: pointer;
    outline: none;
}

.city-filter:focus {
    border-color: var(--primary-color);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hofjes List */
.hofjes-list {
    padding: 8px 0;
}

.list-count {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.hofje-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.hofje-item:hover {
    background: var(--surface-variant);
}

.hofje-item.selected {
    background: rgba(25, 118, 210, 0.08);
}

.hofje-thumbnail {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-variant);
}

.hofje-thumbnail.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: #fff;
    font-size: 24px;
}

.hofje-info {
    flex: 1;
    min-width: 0;
}

.hofje-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hofje-city {
    font-size: 12px;
    color: var(--text-secondary);
}

.favorite-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.favorite-btn:hover {
    background: var(--surface-variant);
}

.favorite-btn svg {
    width: 20px;
    height: 20px;
}

.favorite-btn.active {
    color: var(--secondary-color);
}

/* Favorites List */
.favorites-list {
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
}

/* About Section */
.about-section {
    padding: 24px;
}

.about-content {
    max-width: 500px;
    margin: 0 auto;
}

.about-icon {
    width: 56px;
    height: 56px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.about-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 20px;
    background: var(--surface);
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.about-text {
    margin-bottom: 24px;
}

.about-text p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Feedback Section */
.feedback-section {
    margin: 32px 0;
    padding: 24px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.feedback-section h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 18px;
}

.feedback-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.rating-stars {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.star-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px;
    position: relative;
}

.star-btn:hover {
    color: #ffc107;
    transform: scale(1.1);
}

.star-btn.active {
    color: #ffc107;
    animation: starPulse 0.3s ease-out;
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
}

.feedback-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.feedback-email {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}

.feedback-email:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-feedback-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-feedback-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.submit-feedback-btn:active {
    transform: translateY(0);
}

.submit-feedback-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

.feedback-status {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.feedback-status.success,
.feedback-status.error {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    font-weight: 600;
}

.feedback-status.success::before {
    content: "✓ ";
    font-size: 16px;
}

.feedback-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    font-weight: 600;
}

.feedback-status.error::before {
    content: "⚠ ";
    font-size: 16px;
}

.version-info {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.version-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0;
}

/* ===== Center Panel: Map ===== */
.center-panel {
    flex: 1;
    position: relative;
}

.map-container {
    width: 100%;
    height: 100%;
}

/* Leaflet customizations */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 12px;
    min-width: 180px;
}

/* Custom marker styles */
.hofje-marker {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.2s;
}

.hofje-marker:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.leaflet-marker-icon.selected {
    border-color: var(--secondary-color);
    transform: scale(1.2);
    z-index: 1000 !important;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.3);
}

/* Old custom marker styles - kept for fallback */
.custom-marker {
    background: var(--primary-color);
    color: #fff;
    border: 3px solid #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.custom-marker:hover {
    transform: scale(1.1);
}

.custom-marker.selected {
    background: var(--secondary-color);
    transform: scale(1.2);
    z-index: 1000 !important;
}

/* ===== Right Panel: Details ===== */
/* ===== Right Panel (Detail) ===== */
.right-panel {
    width: 0;
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease;
}

.right-panel.visible {
    width: 400px;
    flex-shrink: 0;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.detail-header {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.close-btn:hover {
    background: var(--surface-variant);
}

.close-btn svg {
    width: 20px;
    height: 20px;
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    width: 100%;
    box-sizing: border-box;
}

.detail-image {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 16px;
    background: var(--surface-variant);
}

.detail-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: #fff;
    font-size: 48px;
}

.detail-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.detail-location svg {
    width: 18px;
    height: 18px;
}

.detail-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.section-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.section-content p {
    margin-bottom: 14px;
}

/* Markdown content styling */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    color: var(--text-primary);
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 12px;
}

.markdown-content h1 {
    font-size: 22px;
}

.markdown-content h2 {
    font-size: 19px;
}

.markdown-content h3 {
    font-size: 17px;
}

.markdown-content h4 {
    font-size: 15px;
}

.markdown-content p {
    margin-bottom: 14px;
    line-height: 1.75;
    font-size: 15px;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.markdown-content li {
    margin-bottom: 8px;
    line-height: 1.7;
    font-size: 15px;
}

.markdown-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

.markdown-content em {
    font-style: italic;
}

.markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.markdown-content code {
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.markdown-content pre {
    background: var(--surface);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    :root {
        --left-panel-width: 300px;
    }
}

@media (max-width: 768px) {
    /* Hero Banner - Mobile */
    .hero-banner {
        padding: 16px 20px;
    }
    
    .hero-title {
        font-size: 18px;
    }
    
    .hero-description {
        font-size: 13px;
    }
    
    /* App Layout - Mobile */
    .app-container {
        flex-direction: column;
    }
    
    .right-container {
        flex: 1;
    }
    
    .left-panel {
        width: 100%;
        max-height: 40vh;
    }
    
    .map-detail-container {
        flex: 1;
    }
    
    .center-panel {
        flex: 1 !important;
    }
    
    .right-panel.visible {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        z-index: 1000;
    }
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-variant);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
