/* Modern Mixed Layout - Cards + Lists */

:root {
    /* Dark mode colors (DEFAULT) - Softer than pure black */
    --primary: #4DD0E1;
    --primary-dark: #00ACC1;
    --secondary: #FF8A65;
    --accent: #FFA726;
    --success: #66BB6A;
    --warning: #FFA726;
    --error: #EF5350;

    --bg: #121212;
    --surface: #1E1E1E;
    --border: #2D2D2D;
    --text: #E0E0E0;
    --text-secondary: #B0B0B0;
    --text-muted: #808080;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 24px rgba(0,0,0,0.5);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode (optional toggle) */
body.light-mode {
    --primary: #00B8D4;
    --primary-dark: #008BA3;
    --secondary: #FF6F61;
    --accent: #FFD54F;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --text: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 24px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== APP BAR ========== */
.app-bar {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.app-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-emoji {
    font-size: 32px;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.icon-button:hover {
    background: var(--border);
    transform: scale(1.05);
}

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

.icon-button.primary:hover {
    background: var(--primary-dark);
}

/* Search */
.search-container {
    padding: 0 20px 16px;
    transition: all var(--transition);
}

.search-container.hidden {
    display: none;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
}

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

.search-box input {
    flex: 1;
    border: none;
    background: none;
    font-size: 16px;
    color: var(--text);
    outline: none;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

/* ========== CATEGORY TABS ========== */
.category-tabs {
    display: flex;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 73px;
    z-index: 90;
}

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

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 14px 16px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.tab-btn i {
    font-size: 20px;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--bg);
}

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

/* Section Container */
.section-container {
    display: none;
}

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

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

.section-header h2 {
    font-size: 28px;
    font-weight: 800;
}

.section-stats {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 8px 16px;
    border-radius: var(--radius-md);
}

/* Subcategory */
.subcategory {
    margin-bottom: 40px;
}

.subcategory-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.subcategory-title i {
    color: var(--primary);
}

/* ========== CARD GRID (for main spots) ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.spot-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.spot-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.spot-card.visited {
    opacity: 0.7;
}

.spot-card.visited::after {
    content: '✓';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    z-index: 10;
}

.card-image {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

/* Overlay sombre sur les photos pour garder les boutons lisibles */
.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    z-index: 2;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.card-actions-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.quick-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}

.quick-btn:hover {
    transform: scale(1.1);
    background: white;
}

.quick-btn.active {
    background: var(--error);
    color: white;
}

.card-content {
    padding: 16px;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.card-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta i {
    color: var(--primary);
}

.badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
}

.badge.ultra-local {
    background: var(--error);
    color: white;
}

.badge.rating {
    background: var(--success);
    color: white;
}

.badge.price {
    background: var(--accent);
    color: var(--text);
}

/* ========== SIMPLE LIST (for quick info) ========== */
.simple-list {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}

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

.list-item:hover {
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.list-item.visited {
    opacity: 0.6;
}

.list-item.visited .list-item-name {
    text-decoration: line-through;
}

.list-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.list-checkbox:hover {
    border-color: var(--success);
}

.list-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.list-item-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.list-item-actions {
    display: flex;
    gap: 6px;
}

.list-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.list-action-btn:hover {
    background: var(--border);
}

.list-action-btn.active {
    background: var(--error);
    color: white;
}

/* ========== COMPACT TABLE (for grocery/tools) ========== */
.compact-table {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: var(--bg);
}

.table-row.visited {
    opacity: 0.6;
}

/* ========== DETAILS PANEL ========== */
.details-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 450px;
    max-width: 100%;
    height: 100vh;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 300;
    display: flex;
    flex-direction: column;
}

.details-panel.active {
    transform: translateX(0);
}

.details-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.details-header h3 {
    font-weight: 700;
    font-size: 18px;
}

.details-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ========== CHAT PANEL ========== */
.chat-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 350;
    display: flex;
    flex-direction: column;
}

.chat-panel.active {
    transform: translateX(0);
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message-ai {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message-bubble {
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    max-width: 80%;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.chat-input-area textarea {
    flex: 1;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
}

.send-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.send-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ========== OVERLAY ========== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 250;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ========== TOOL WIDGETS ========== */
.tool-widget {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.tool-icon {
    font-size: 32px;
}

.tool-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.tool-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.currency-input-group label,
.currency-output-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.currency-input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition);
}

.currency-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.conversion-arrow {
    text-align: center;
    color: var(--primary);
    font-size: 24px;
    margin: -4px 0;
}

.currency-result {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 28px;
    font-weight: 800;
    text-align: center;
}

.tool-note {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
}

.quick-conversions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.quick-btn-currency {
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.quick-btn-currency:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Tip Calculator */
.tip-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tip-result {
    padding: 16px 12px;
    background: var(--bg);
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.tip-result.highlight {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tip-percentage {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tip-amount {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}

.tip-total {
    font-size: 12px;
    opacity: 0.8;
}

/* Weather Widget */
.weather-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.weather-day {
    background: var(--bg);
    padding: 16px 12px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px solid var(--border);
}

.weather-date {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.weather-icon {
    font-size: 32px;
    margin: 8px 0;
}

.weather-temp {
    font-size: 20px;
    font-weight: 800;
    margin: 8px 0;
}

.weather-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Practical Info */
.info-section {
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius-md);
}

.info-section h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.phrase-list,
.contact-list,
.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.phrase-list li,
.contact-list li,
.tips-list li {
    padding: 8px 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.6;
}

.phrase-list strong,
.contact-list strong {
    color: var(--primary);
    display: inline-block;
    min-width: 180px;
}

.tips-list li {
    padding-left: 28px;
    position: relative;
}

.tips-list li::before {
    content: '•';
    position: absolute;
    left: 12px;
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.bottom-nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

.bottom-nav-item:hover {
    color: var(--primary);
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* Add padding to main content to account for bottom nav */
.main-content {
    padding-bottom: 80px; /* Space for bottom nav */
}

/* ========== TOURIST LEVEL BADGES ========== */
.tourist-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.tourist-badge.popular {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A52 100%);
    color: white;
}

.tourist-badge.less-touristy {
    background: linear-gradient(135deg, #51CF66 0%, #37B24D 100%);
    color: white;
}

.tourist-badge.ultra-local {
    background: linear-gradient(135deg, #4DD0E1 0%, #00ACC1 100%);
    color: white;
}

/* Badge in cards */
.spot-card .tourist-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

/* Badge in list items */
.list-item .tourist-badge {
    margin-left: 8px;
    flex-shrink: 0;
}

/* Badge filters */
.badge-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.badge-filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.badge-filter-chip:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.badge-filter-chip.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.badge-filter-chip.popular {
    border-color: #FF6B6B;
}

.badge-filter-chip.popular.active {
    background: #FF6B6B;
    border-color: #FF6B6B;
}

.badge-filter-chip.less-touristy {
    border-color: #51CF66;
}

.badge-filter-chip.less-touristy.active {
    background: #51CF66;
    border-color: #51CF66;
}

.badge-filter-chip.ultra-local {
    border-color: #4DD0E1;
}

.badge-filter-chip.ultra-local.active {
    background: #4DD0E1;
    border-color: #4DD0E1;
}

/* Hide popular toggle */
.hide-popular-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
}

.hide-popular-toggle:hover {
    background: var(--bg);
}

.hide-popular-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.hide-popular-toggle label {
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}

/* ========== UTILITIES ========== */
.hidden {
    display: none !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .app-bar-content {
        padding: 12px 16px;
    }

    .logo-text h1 {
        font-size: 18px;
    }

    .category-tabs {
        top: 64px;
    }

    .main-content {
        padding: 16px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .details-panel, .chat-panel {
        width: 100%;
    }

    .tab-btn {
        min-width: 80px;
        font-size: 12px;
    }

    .tab-btn i {
        font-size: 18px;
    }
}
