/* Global Base Styles */
:root {
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #bb86fc;
    --accent-hover: #9965f4;
    --danger: #cf6679;
    --border: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    /* Prevent scrolling on body, handled by containers */
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    width: 100vw;
}


/* Mobile-only Navigation Elements (Hidden on Desktop) */
.mobile-header,
.mobile-bottom-dock,
.sidebar-backdrop,
.sidebar-close-btn {
    display: none !important;
}

/* Sidebar - Modern Stealth Glass Aesthetic */
.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #181920 0%, #111216 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    padding: 20px 14px 14px 14px;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5);
    z-index: 10;
    box-sizing: border-box;
    position: relative;
    user-select: none;
}

/* Logo & Branding */
.logo {
    margin-bottom: 20px;
    padding: 0 6px 14px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.2) 0%, rgba(0, 229, 255, 0.15) 100%);
    border: 1px solid rgba(187, 134, 252, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.25rem;
    box-shadow: 0 0 15px rgba(187, 134, 252, 0.25);
    transition: transform 0.3s ease;
}

.logo:hover .logo-icon-box {
    transform: rotate(45deg);
}

.logo-text-group h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 40%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.logo-tagline {
    font-size: 0.68rem;
    color: #7a7e8e;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

/* Menu Container */
.menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

/* Custom Scrollbar for Menu */
.menu::-webkit-scrollbar {
    width: 4px;
}
.menu::-webkit-scrollbar-track {
    background: transparent;
}
.menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
.menu::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Category Section Titles */
.menu-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #606474;
    margin: 10px 0 4px 8px;
    display: block;
}

/* Buttons Base */
.menu-btn {
    background: rgba(255, 255, 255, 0.03);
    color: #c8cbd6;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 7px 10px;
    border-radius: 9px;
    cursor: pointer;
    text-align: left;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
}

.menu-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    color: #9da2b4;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover States */
.menu-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(187, 134, 252, 0.3);
    color: #ffffff;
    transform: translateX(4px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.menu-btn:hover .menu-icon-wrap {
    background: rgba(187, 134, 252, 0.15);
    color: var(--accent);
}

/* Primary Action: Ajouter Exploration */
.menu-btn.primary-action {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.18) 0%, rgba(153, 101, 244, 0.08) 100%);
    border: 1px solid rgba(187, 134, 252, 0.45);
    color: #e5ceff;
    box-shadow: 0 3px 12px rgba(187, 134, 252, 0.12);
}

.menu-btn.primary-action .menu-icon-wrap {
    background: rgba(187, 134, 252, 0.25);
    color: var(--accent);
}

.menu-btn.primary-action:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 4px 18px rgba(187, 134, 252, 0.4);
}

.menu-btn.primary-action:hover .menu-icon-wrap {
    background: rgba(0, 0, 0, 0.2);
    color: #000;
}

/* Dépenses & Budget */
.menu-btn.btn-expenses {
    background: rgba(0, 230, 118, 0.04);
    border-color: rgba(0, 230, 118, 0.28);
    color: #00E676;
}

.menu-btn.btn-expenses .menu-icon-wrap {
    background: rgba(0, 230, 118, 0.12);
    color: #00E676;
}

.menu-btn.btn-expenses:hover {
    background: rgba(0, 230, 118, 0.14);
    border-color: #00E676;
    color: #fff;
    box-shadow: 0 3px 14px rgba(0, 230, 118, 0.25);
}

/* Killo-Price */
.menu-btn.btn-kiloprice {
    background: rgba(255, 215, 0, 0.04);
    border-color: rgba(255, 215, 0, 0.28);
    color: #FFD700;
}

.menu-btn.btn-kiloprice .menu-icon-wrap {
    background: rgba(255, 215, 0, 0.12);
    color: #FFD700;
}

.menu-btn.btn-kiloprice:hover {
    background: rgba(255, 215, 0, 0.14);
    border-color: #FFD700;
    color: #fff;
    box-shadow: 0 3px 14px rgba(255, 215, 0, 0.25);
}

/* Secondary Actions (Import / Export) */
.menu-btn.secondary {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: #8b8f9e;
}

.menu-btn.secondary .menu-icon-wrap {
    background: transparent;
    color: #7b8090;
}

.menu-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: #e0e2ec;
}

/* Dividers */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    margin: 8px 0;
}

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px 2px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 8px;
    font-size: 0.72rem;
    color: #606474;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.pulse-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #00E676;
    box-shadow: 0 0 8px #00E676;
    display: inline-block;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* Map Wrapper */
.map-wrapper {
    flex-grow: 1;
    position: relative;
    background-color: black;
}

#map {
    width: 100%;
    height: 100%;
}

/* Modals */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-content.large {
    max-width: 600px;
    height: 80vh;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-weight: 500;
    color: var(--accent);
}

.close-btn {
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-toolbar {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input,
textarea {
    width: 100%;
    padding: 10px;
    background-color: #121212;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    box-sizing: border-box;
    /* Fix padding expanding width */
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.hint {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 15px;
    font-style: italic;
}

.save-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--accent);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.save-btn:hover {
    background-color: var(--accent-hover);
}

/* List View */
.urbex-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.urbex-item {
    background-color: #252525;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
}

.urbex-item:hover {
    border-color: var(--border);
}

.urbex-info h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.urbex-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.item-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: color 0.2s;
    padding: 5px;
}

.icon-btn.delete:hover {
    color: var(--danger);
}

.icon-btn.edit:hover {
    color: var(--accent);
}

/* Popup Styles */
.maplibregl-popup-content {
    background-color: var(--bg-panel) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border);
    padding: 15px !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow) !important;
    min-width: 200px;
}

.maplibregl-popup-tip {
    border-top-color: var(--bg-panel) !important;
    border-bottom-color: var(--bg-panel) !important;
}

.popup-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.popup-header h4 {
    margin: 0;
    color: var(--accent);
}

.popup-body {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.popup-actions {
    display: flex;
    justify-content: space-around;
    gap: 5px;
}

.btn-xs {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
}

.btn-edit {
    background-color: #333;
    color: white;
}

.btn-delete {
    background-color: rgba(207, 102, 121, 0.2);
    color: var(--danger);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent);
    color: #000;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 2000;
    transition: opacity 0.3s;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Responsive */


/* --- Generic Styles (Moved from Media Query) --- */

/* Stats Box */
.text-center {
    text-align: center;
}

.stat-box {
    background-color: #252525;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 5px;
}

/* Settings Items */
.setting-item {
    padding: 15px;
    background-color: #252525;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--border);
}

.btn-danger-full {
    width: 100%;
    padding: 12px;
    background-color: rgba(207, 102, 121, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-danger-full:hover {
    background-color: var(--danger);
    color: white;
}

/* Location Picker Button */
.btn-location {
    width: 100%;
    padding: 10px;
    background-color: #333;
    color: var(--text-primary);
    border: 1px dashed var(--accent);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-location:hover {
    background-color: #444;
    border-style: solid;
}

.btn-location.active {
    background-color: var(--accent);
    color: black;
    border-style: solid;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(187, 134, 252, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(187, 134, 252, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(187, 134, 252, 0);
    }
}

/* Export Options */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mt-2 {
    margin-top: 10px;
}

/* Select Styling */
select {
    width: 100%;
    padding: 10px;
    background-color: #121212;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    box-sizing: border-box;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-toolbar.horizontal {
    display: flex;
    gap: 10px;
}

.modal-toolbar.horizontal input {
    flex: 2;
}

.modal-toolbar.horizontal select {
    flex: 1;
}

/* Select Options */
select option {
    width: 100%;
    padding: 10px;

    background-color: #121212;
    border: 1px solid var(--border);
    /* or var(--bg-panel) */
    color: var(--text-primary);
}

/* Primary Action Highlight */
.menu-btn.primary-action {
    background-color: rgba(187, 134, 252, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.menu-btn.primary-action:hover {
    background-color: var(--accent);
    color: black;
}

/* Contact Selection in Task Modal */
.contact-selection-container {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 6px;
    background: #1a1a1a;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.contact-option {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background-color: #2c2c2c;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.contact-option:hover {
    background-color: #383838;
}

.contact-option.selected {
    border-color: var(--accent);
    background-color: rgba(187, 134, 252, 0.1);
}

.contact-option input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    accent-color: var(--accent);
}

.contact-option label {
    margin: 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlight Contact Form when editing */
.contact-form.editing input {
    border-color: var(--accent);
    box-shadow: 0 0 5px rgba(187, 134, 252, 0.2);
}

.contact-form.editing button.primary-action {
    background-color: var(--accent);
    color: black;
    animation: pulse-light 2s infinite;
}

@keyframes pulse-light {
    0% {
        box-shadow: 0 0 0 0 rgba(187, 134, 252, 0.4);
    }

    70% {
        box-shadow: 0 0 0 5px rgba(187, 134, 252, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(187, 134, 252, 0);
    }
}


/* Discord Button */
.menu-btn.discord-btn {
    background-color: #5865F2;
    color: white;
    border-color: #5865F2;
    font-weight: bold;
    margin-top: auto;
    /* Push to bottom if container allows */
}

.menu-btn.discord-btn:hover {
    background-color: #4752C4;
    border-color: #4752C4;
}

/* Loading Screen */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    /* Pitch black */
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Courier New', monospace;
    /* Scary/Technical font */
}

.warning-content {
    max-width: 600px;
    padding: 30px;
    border: 2px solid var(--danger);
    text-align: center;
    background-color: #111;
    box-shadow: 0 0 30px rgba(207, 102, 121, 0.3);
}

.warning-content h1 {
    color: var(--danger);
    font-size: 2rem;
    margin-bottom: 20px;
}

.warning-content ul {
    text-align: left;
    margin: 20px 0;
}

.scary-text {
    font-style: italic;
    color: var(--text-secondary);
    margin: 30px 0;
}

#enterBtn {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

#enterBtn:hover {
    background: var(--danger);
    color: black;
    box-shadow: 0 0 20px var(--danger);
}

/* Button & Badge Tweaks */
.btn-xs {
    padding: 6px 12px;
    /* Better padding */
    font-size: 0.85rem;
}

.type-icon {
    font-size: 1.4rem;
    margin-right: 15px;
    width: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.urbex-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.status-badge {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-left: 8px;
    display: inline-block;
}

.status-accessible {
    color: #81c784;
    border: 1px solid #81c784;
}

.status-guarded {
    color: #2962ff;
    border: 1px solid #2962ff;
}

.status-closed {
    color: #e57373;
    border: 1px solid #e57373;
}

.status-demolished {
    color: #eee;
    text-decoration: line-through;
}

.status-squatted {
    color: #ffd600;
    border: 1px solid #ffd600;
}

.status-new {
    color: #8f6d46ff;
    border: 1px solid #8f6d46ff;
}

.status-unknown {
    color: #999;
}

.urbex-info {
    display: flex;
    align-items: center;
}

/* Map Filter Overlay */
.map-filter-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    background: rgba(30, 30, 30, 0.9);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.map-filter-overlay select {
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 5px 10px;
    width: 200px;
}

.map-filter-overlay select:focus {
    outline: none;
}

/* Crosshair Cursor for Picker */
.map-picking-mode {
    cursor: crosshair !important;
}

.map-picking-mode canvas {
    cursor: crosshair !important;
}

/* Google Maps Link */
.gmap-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
}

.gmap-link:hover {
    text-decoration: underline;
}

/* Kiloprice Styles */
.readonly-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-style: italic;
}

.result-box .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.redlikews {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--danger), rgba(0, 0, 0, 0));
    margin: 10px 0;
}

.result-box strong {
    color: var(--accent);
}

.result-box .error {
    color: var(--danger);
    font-weight: bold;
}

/* Schedule Table Inputs */
.sched-input {
    width: 60px !important;
    /* Force width for small table cells */
    padding: 5px !important;
    text-align: center;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
}

.sched-input:focus {
    border-color: var(--accent) !important;
}

/* Habit Tracking (Pompes) */
.calendar-day.success {
    border: 2px solid #00E676 !important;
    /* Green */
    box-shadow: inset 0 0 10px rgba(0, 230, 118, 0.2);
}

.calendar-day.fail {
    border: 2px solid #FF1744 !important;
    /* Red */
    box-shadow: inset 0 0 10px rgba(255, 23, 68, 0.2);
}

/* Specific item style for Pompes */
.urbex-item.pompes-task {
    background-color: #263238 !important;
    /* Dark Blue-Grey */
    border-left: 3px solid #00E676;
}

/* Tabs */
.tabs {
    display: flex;
    background-color: #1a1a1a;
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: bold;
    background-color: rgba(187, 134, 252, 0.05);
}

.tab:hover {
    color: var(--text-primary);
    background-color: #252525;
}

/* Updated Toolbar for multiple filters */
.modal-toolbar.horizontal.wrap-mobile {
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .modal-toolbar.horizontal.wrap-mobile {
        flex-direction: column;
        gap: 8px;
    }

    .modal-toolbar.horizontal input,
    .modal-toolbar.horizontal select {
        width: 100%;
        flex: none;
    }
}

/* Favorite Button */
.btn-fav {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #444;
    /* Inactive color */
    transition: transform 0.2s, color 0.2s;
}

.btn-fav.active {
    color: #FFD700;
    /* Gold */
}

.btn-fav:hover {
    transform: scale(1.2);
}

/* Date Display */
.date-added {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    display: block;
}

/* Calendar Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.calendar-header-cell {
    font-weight: bold;
    text-align: center;
    color: var(--accent);
    padding: 10px 0;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.calendar-day {
    background-color: #2c2c2c;
    border-radius: 6px;
    height: 80px;
    padding: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    /* Number top right */
}

.calendar-day:hover {
    background-color: #383838;
    border-color: var(--accent);
}

.calendar-day.empty {
    background-color: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    border-color: transparent;
}

.calendar-day.today {
    border: 2px solid var(--accent);
    box-shadow: 0 0 10px rgba(187, 134, 252, 0.2);
}

.day-number {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-secondary);
}

.calendar-day:hover .day-number {
    color: white;
}

/* Star Rating Widget (JS Based) */
.rating-widget {
    display: flex;
    gap: 5px;
    font-size: 1.8rem;
    cursor: pointer;
    margin-bottom: 5px;
}

.rating-widget span {
    color: #444;
    /* Inactive */
    transition: color 0.1s, transform 0.1s;
}

.rating-widget span:hover {
    transform: scale(1.2);
}

.rating-widget span.active,
.rating-widget span.hover {
    color: #FFD700;
    /* Gold */
}

/* Table Styles for Stats */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.stats-table th,
.stats-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.stats-table th {
    color: var(--text-secondary);
    font-weight: normal;
}

.stats-table td {
    color: var(--text-primary);
}

.stats-table tr:last-child td {
    border-bottom: none;
}

/* Objectives Feature */
.obj-card {
    display: flex;
    background-color: #1f1f1f;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.obj-card.done {
    border-color: #00E676;
    opacity: 0.8;
}

.obj-card:hover {
    transform: translateY(-2px);
}

.obj-img-container {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.obj-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.obj-content {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.obj-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.obj-title {
    font-weight: bold;
    font-size: 1rem;
    margin: 0;
    color: var(--text-primary);
}

.obj-price {
    font-weight: bold;
    color: #FFD700;
    font-size: 0.9rem;
}

.obj-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.obj-link {
    color: var(--accent);
    font-size: 0.8rem;
    text-decoration: none;
}

.obj-link:hover {
    text-decoration: underline;
}

.obj-btn-group {
    display: flex;
    gap: 5px;
}

.fab-add {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s, transform 0.2s;
}

.fab-add:hover {
    background-color: #9955e8;
    /* Darker accent */
    transform: scale(1.1);
}

/* Infos Page Styles */
.infos-section h4 {
    margin-bottom: 15px;
    color: var(--accent);
    font-size: 1.2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* Premium Weather Widget */
.weather-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    padding: 20px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-height: 120px;
    box-sizing: border-box;
}

.weather-current {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1 1 180px;
}

.weather-temp {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.weather-desc {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 5px;
    text-transform: capitalize;
}

.weather-forecast {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 10px 8px;
    border-radius: 8px;
    min-width: 65px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.forecast-day div:first-child {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

/* Mobile responsive for weather widget */
@media (max-width: 600px) {
    .weather-container {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 14px;
    }

    .weather-current {
        justify-content: space-around;
        width: 100%;
        flex: none;
    }

    .weather-temp {
        font-size: 2.4rem;
    }

    .weather-forecast {
        width: 100%;
        justify-content: space-between;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .forecast-day {
        min-width: 0;
        padding: 8px 4px;
    }
}

/* News Styles */
.news-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-item {
    background: #252525;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.news-title {
    font-size: 1rem;
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    color: #f0f0f0;
    text-decoration: none;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-break: break-word;
}

.news-title:hover {
    color: var(--accent);
}

.news-meta {
    font-size: 0.8rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-meta span {
    background: #333;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Scrollbar for news */
.news-container::-webkit-scrollbar {
    width: 6px;
}

.news-container::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 3px;
}

.loading-spinner {
    width: 100%;
    text-align: center;
    padding: 40px;
    color: #888;
    font-style: italic;
    font-size: 1.1rem;
}

/* --- Manga One Piece Section --- */
.manga-section {
    padding: 10px 0;
}

.manga-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.manga-case {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    color: #888;
}

.manga-case:hover {
    background-color: #333;
    border-color: #666;
}

.manga-case.owned {
    background-color: #00C853;
    /* Green */
    color: #fff;
    border-color: #00E676;
    font-weight: bold;
    box-shadow: 0 0 5px rgba(0, 200, 83, 0.4);
}

.manga-case.new-release {
    border-color: #FFD600;
    /* Yellow */
    color: #FFD600;
}

/* Welcome Intro */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
}

.welcome-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.welcome-content {
    text-align: center;
    animation: welcomeFadeIn 2s ease-out;
}

.welcome-title {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 12px;
    margin-bottom: 10px;
    background: linear-gradient(to bottom, #fff 0%, #aaa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: 4px;
    margin-bottom: 40px;
    opacity: 0.8;
}

.welcome-btn {
    padding: 15px 40px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #000;
    background: var(--accent);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 214, 0, 0.3);
}

.welcome-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 214, 0, 0.5);
    background: #fff;
}

@keyframes welcomeFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Mobile Optimization for Intro */
@media (max-width: 768px) {
    .welcome-title {
        font-size: 2.5rem;
        letter-spacing: 6px;
    }

    .welcome-subtitle {
        font-size: 1rem;
        letter-spacing: 2px;
        padding: 0 20px;
        line-height: 1.4;
    }

    .welcome-btn {
        padding: 12px 30px;
        font-size: 0.9rem;
    }
}

/* Utility */
.hidden {
    display: none !important;
}

/* Mobile Optimization for List Modal */
@media (max-width: 768px) {
    .modal-toolbar.horizontal.wrap-mobile {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .modal-toolbar.horizontal.wrap-mobile input#searchBar {
        grid-column: 1 / -1;
        /* Full width */
        width: 100%;
    }

    .modal-toolbar.horizontal.wrap-mobile select {
        width: 100%;
        min-width: 0;
        font-size: 0.85rem;
        padding: 8px;
    }
}

/* Manga Price Modal */
.small-modal {
    max-width: 400px;
    width: 90%;
}

.price-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 10px;
}

.price-buttons-grid button {
    padding: 15px;
    font-size: 1.2rem;
    background-color: #333;
    border: 1px solid #555;
    transition: all 0.2s;
}

.price-buttons-grid button:hover {
    background-color: var(--accent);
    color: #000;
    transform: scale(1.05);
    border-color: var(--accent);
}
@media (max-width: 768px) {
    /* Mobile App Container */
    .app-container {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        width: 100vw;
        position: relative;
        overflow: hidden;
    }

    .map-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
        flex: 1;
    }

    #map {
        width: 100%;
        height: 100%;
    }

    /* Mobile Header Pill Bar */
    .mobile-header {
        display: flex !important;
        position: absolute;
        top: 12px;
        left: 12px;
        right: 12px;
        z-index: 40;
        justify-content: space-between;
        align-items: center;
        pointer-events: none;
    }

    .mobile-brand-pill {
        display: flex;
        align-items: center;
        gap: 8px;
        background: rgba(22, 23, 29, 0.85);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        padding: 7px 14px;
        color: #ffffff;
        font-weight: 700;
        font-size: 0.9rem;
        pointer-events: auto;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    }

    .mobile-brand-pill i {
        color: var(--accent);
        font-size: 1rem;
    }

    .mobile-menu-toggle-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(22, 23, 29, 0.85);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        pointer-events: auto;
        cursor: pointer;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
        transition: transform 0.2s ease, background 0.2s ease;
    }

    .mobile-menu-toggle-btn:active {
        transform: scale(0.92);
        background: rgba(187, 134, 252, 0.2);
    }

    /* Move Map Filter overlay down on mobile */
    .map-filter-overlay {
        top: 64px !important;
        right: 12px !important;
        left: auto !important;
    }

    /* Mobile Floating Bottom Dock */
    .mobile-bottom-dock {
        display: flex !important;
        position: absolute;
        bottom: 12px;
        left: 12px;
        right: 12px;
        z-index: 40;
        align-items: center;
        justify-content: space-around;
        background: rgba(20, 21, 28, 0.9);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 22px;
        padding: 5px 6px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
        padding-bottom: max(6px, env(safe-area-inset-bottom));
    }

    .dock-btn {
        background: none;
        border: none;
        color: #8f93a2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        font-size: 0.68rem;
        font-weight: 600;
        cursor: pointer;
        padding: 4px 6px;
        flex: 1;
        transition: all 0.2s ease;
        outline: none;
    }

    .dock-btn i {
        font-size: 1.15rem;
    }

    .dock-btn:active {
        transform: scale(0.92);
        color: #ffffff;
    }

    .dock-btn.primary {
        color: var(--accent);
        position: relative;
        margin-top: -16px;
    }

    .dock-primary-bubble {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #000;
        font-size: 1.25rem;
        box-shadow: 0 4px 16px rgba(187, 134, 252, 0.5);
        transition: transform 0.2s ease;
    }

    .dock-btn.primary:active .dock-primary-bubble {
        transform: scale(0.92);
    }

    /* Mobile Sidebar Drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 84%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        z-index: 1000;
        transform: translateX(-105%);
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.8);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        padding: 16px;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Close button in mobile sidebar */
    .sidebar-close-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #bbb;
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.2s;
    }

    .sidebar-close-btn:active {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }

    /* Dark blurred backdrop overlay */
    .sidebar-backdrop {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    /* Ensure text & icons are fully visible in drawer */
    .menu-text {
        display: inline-block;
        font-size: 0.9rem;
    }

    .menu-icon-wrap {
        display: flex;
    }

    .menu-btn {
        padding: 10px 12px;
        transform: none !important;
    }

    .menu-section-title {
        display: block;
    }

    .logo {
        display: flex;
    }

    .sidebar-footer {
        display: flex;
    }
}

/* --- Fix Calendrier : Boutons compacts & Input anti-inversion mobile --- */
.btn-cal-action {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 42px !important;
    border-radius: 8px;
    background: #2a2a2a;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0 !important;
    transition: all 0.2s ease;
    padding: 0 !important;
    box-sizing: border-box;
}

.btn-cal-action:hover {
    background: #383838;
    border-color: var(--accent);
}

.btn-cal-action:active {
    transform: scale(0.95);
}

.btn-cal-action.btn-cal-primary {
    background: var(--accent);
    color: #000;
    font-weight: bold;
    font-size: 1.35rem;
    border-color: var(--accent);
}

.btn-cal-action.btn-cal-primary:hover {
    background: var(--accent-hover);
}

/* Sécurité anti-inversion du texte sur les téléphones */
#dayTaskInput {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: plaintext !important;
    -webkit-user-select: text !important;
    user-select: text !important;
}

#dayModal .form-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}
