/* === been.bio — Custom styles (Tailwind handles the rest) === */

/* Animations */
@keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

html {
    overflow-x: hidden;
    background: #f5f7fb;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: auto;
}

body {
    overflow-x: hidden;
    background: #f5f7fb;
}

/* App container */
#app {
    min-height: 100vh;
    min-height: 100dvh;
}

/* Leaflet map overrides */
.leaflet-container { font-family: 'Inter', sans-serif !important; }
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
    padding: 0 !important;
}
.leaflet-popup-content { margin: 10px 14px !important; }
.leaflet-popup-tip { display: none; }

/* jsvectormap overrides */
.jvm-container {
    width: 100% !important;
    height: 100% !important;
}
.jvm-container svg {
    width: 100% !important;
    height: 100% !important;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Quick Post Composer === */
.quick-post-composer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-post-composer.hidden {
    display: none;
}

.quick-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.quick-post-panel {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.2s ease-out;
}

.quick-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.quick-post-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.quick-post-header .close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.quick-post-header .close-btn:hover {
    background: #f3f4f6;
}

.quick-post-body {
    padding: 20px;
}

#quick-post-text {
    width: 100%;
    border: none;
    resize: none;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    outline: none;
    min-height: 80px;
}

#quick-post-text::placeholder {
    color: #9ca3af;
}

.quick-post-media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.media-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-item .media-type-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
}

.media-preview-item .remove-media {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-post-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.media-upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: background 0.2s;
}

.media-upload-btn:hover {
    background: #e5e7eb;
}

.location-input {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 8px;
    flex: 1;
    min-width: 150px;
}

.location-input input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100%;
}

.trip-select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    outline: none;
}

.trip-select:focus {
    border-color: #3b82f6;
}

.quick-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

.mobile-app-shell {
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
    padding: 20px 16px calc(40px + env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(circle at top left, rgba(191, 219, 254, 0.86), transparent 30%),
        radial-gradient(circle at top right, rgba(224, 231, 255, 0.92), transparent 28%),
        radial-gradient(circle at bottom right, rgba(219, 234, 254, 0.7), transparent 24%),
        linear-gradient(180deg, #f9fbff 0%, #f5f7fb 48%, #eef2ff 100%);
}

@media (max-width: 767px) {
    html,
    body,
    #app {
        height: 100%;
        min-height: 100svh;
        min-height: 100dvh;
    }

    html,
    body {
        overscroll-behavior: none;
    }

    body {
        overflow-anchor: none;
    }

    .mobile-app-shell {
        min-height: calc(100svh - 64px);
        min-height: calc(100dvh - 64px);
        overscroll-behavior: none;
    }

    input,
    select,
    textarea,
    button,
    [contenteditable="true"] {
        font-size: 16px !important;
    }

    input,
    select,
    textarea,
    [contenteditable="true"] {
        transform: none !important;
        zoom: 1;
    }
}


.mobile-dashboard-hero,
.mobile-surface-card,
.mobile-feed-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 22px 55px -28px rgba(15, 23, 42, 0.24);
}

.mobile-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 92px;
    padding: 14px 12px;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 14px 34px -24px rgba(15, 23, 42, 0.24);
}

.mobile-action-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border: 1px solid rgba(191, 219, 254, 0.95);
    color: #1d4ed8;
    font-size: 18px;
    box-shadow: 0 10px 22px -18px rgba(37, 99, 235, 0.45);
}

.mobile-action-btn-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.mobile-action-btn-subtitle {
    font-size: 11px;
    line-height: 1.2;
    color: #6b7280;
}

.mobile-action-btn.is-primary {
    background: linear-gradient(180deg, rgba(239,246,255,0.98), rgba(224,231,255,0.98));
    border-color: rgba(191, 219, 254, 0.95);
}

.mobile-action-btn.is-primary .mobile-action-btn-icon {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white;
    border-color: transparent;
}

.mobile-action-btn.is-muted .mobile-action-btn-icon {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    color: #475569;
    border-color: rgba(226, 232, 240, 0.95);
}

.beenboard-page-header {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
}

.beenboard-page-intro {
    min-width: 0;
}

.beenboard-inline-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.beenboard-toolbar-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: white;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 12px 30px -24px rgba(15, 23, 42, 0.2);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.beenboard-toolbar-back:hover {
    background: #f8fafc;
    border-color: rgba(191, 219, 254, 0.95);
    color: #1e293b;
}

.beenboard-create-grid {
    display: grid;
    grid-template-columns: repeat(5, 48px);
    gap: 8px;
    align-items: center;
}

.beenboard-create-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    color: #475569;
    font-size: 18px;
    box-shadow: 0 12px 28px -24px rgba(15, 23, 42, 0.22);
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.beenboard-create-icon:hover {
    transform: translateY(-1px);
    border-color: rgba(191, 219, 254, 0.95);
    color: #1d4ed8;
    background: linear-gradient(180deg, rgba(239,246,255,0.98), rgba(224,231,255,0.96));
}

.beenboard-toolbar-spacer {
    flex: 1 1 24px;
}

.beenboard-toolbar-button {
    min-height: 48px;
}

.beenboard-editor-note {
    border: 1px solid rgba(191, 219, 254, 0.95);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(224, 231, 255, 0.96));
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    padding: 12px 14px;
}

.beenboard-canvas-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.beenboard-canvas-zoom .board-zoom-controls {
    min-height: 44px;
}

.story-cover-media {
    image-orientation: from-image;
}

.board-zoom-controls,
.board-zoom-button,
.beenboard-create-icon {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 767px) {
    .beenboard-create-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        width: 100%;
    }

    .beenboard-create-icon {
        width: 100%;
    }

    .beenboard-toolbar-spacer {
        display: none;
    }

    .beenboard-toolbar-button {
        flex: 1 1 calc(50% - 6px);
    }
}

@media (min-width: 1024px) {
    .beenboard-inline-toolbar {
        flex-wrap: nowrap;
    }
}

.mobile-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mobile-stat-card {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e5e7eb;
    padding: 14px 10px;
    text-align: center;
}

.mobile-timeline-line {
    position: relative;
    padding-left: 18px;
    margin-left: 6px;
    border-left: 2px solid #e5e7eb;
}

.mobile-timeline-line::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: #3b82f6;
    border: 2px solid #fff;
}

@media (max-width: 768px) {
    .toast-msg {
        left: 16px;
        right: 16px;
        bottom: 88px;
        text-align: center;
    }

    .mobile-app-shell .group.relative.bg-white.border.border-gray-100.rounded-2xl {
        border-radius: 28px;
        box-shadow: 0 18px 50px -24px rgba(15, 23, 42, 0.22);
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(16px);
        border-color: rgba(255, 255, 255, 0.75);
    }
}

.char-count {
    font-size: 13px;
    color: #9ca3af;
}

.post-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.post-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === Post Cards === */
.post-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.post-author-info {
    display: flex;
    flex-direction: column;
}

.post-author-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
}

.post-author-handle {
    color: #6b7280;
    font-size: 13px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-time {
    color: #9ca3af;
    font-size: 13px;
}

.post-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.post-delete-btn:hover {
    opacity: 1;
    background: #fee2e2;
}

.post-content {
    padding: 0 16px 16px;
}

.post-content p {
    margin: 0;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-media-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4px;
    margin: 0 16px 16px;
}

.post-media {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.post-media:hover {
    transform: scale(1.02);
}

.post-video {
    max-height: 400px;
    background: #000;
}

.post-footer {
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
}

.post-context {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}

.post-location, .post-trip {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s;
}

.post-action-btn:hover {
    background: #e5e7eb;
}

.post-action-btn.liked {
    color: #ef4444;
    background: #fef2f2;
}

/* === Lightbox === */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 8px;
}

/* === Toast Notification === */
.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #374151;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* === Quick Post FAB Button === */
.quick-post-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quick-post-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* === Posts Feed Container === */
.posts-feed {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

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

.posts-feed-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1f2937;
}