/* ========================================================
   EXTREME SWIPE - STYLE ULTRA-MINIMALISTE (MATHSDOOMSCROLLING)
   SANS CADRES - ICÔNES ET TEXTES PURS SUR FOND VIDÉO
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
    --bg-black: #000000;
    --text-primary: #ffffff;
    --text-muted: #aaaaaa;
    --accent-red: #ff3344;
    --accent-green: #00b865;
    --accent-gold: #f59e0b;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --header-height: 50px;
    --app-max-width: 480px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-mono);
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--bg-black);
    color: var(--text-primary);
    position: fixed;
    touch-action: pan-y;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    color: inherit;
    border: none;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
}

/* Container Global */
.app-container {
    width: 100%;
    height: 100%;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000000;
    position: relative;
}

/* Viewport Smartphone Sans Cadre */
.feed-viewport {
    position: relative;
    width: 100%;
    max-width: var(--app-max-width);
    height: 100%;
    height: 100dvh;
    background-color: var(--bg-black);
    overflow: hidden;
    border: none !important;
    box-shadow: none !important;
}

/* Header Flottant Transparent Sans Cadre */
.feed-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 40;
    padding: 0 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent !important;
    border: none !important;
    pointer-events: auto;
}

/* Sélecteur de Mode Sans Cadre */
.mode-pill-selector {
    display: inline-flex;
    background: transparent !important;
    border: none !important;
    gap: 8px;
}

.mode-pill-btn {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 4px;
    cursor: pointer;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    transition: color 0.15s;
}

.mode-pill-btn:hover {
    color: #fff;
}

.mode-pill-btn.active {
    color: #ffffff;
    border-bottom: 2px solid #ffffff !important;
}

/* Actions Header Sans Cadre */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header {
    background: transparent !important;
    border: none !important;
    color: #fff;
    padding: 4px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    transition: transform 0.1s, opacity 0.1s;
}

.btn-header:hover {
    transform: scale(1.05);
}

.badge-counter {
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 800;
}

/* Video Stage */
.video-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
}

/* Video Card Sans Cadre */
.video-card {
    position: absolute;
    inset: 0 !important;
    width: 100%;
    height: 100%;
    background-color: var(--bg-black);
    display: flex;
    justify-content: center;
    align-items: center;
    will-change: transform, opacity;
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.25s ease;
}

.video-card.dragging {
    transition: none !important;
}

.card-media-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    border: none !important;
}

.card-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Stamps Tinder Épurés Monospace Sans Cadre */
.swipe-stamp {
    position: absolute;
    top: 75px;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    z-index: 35;
    border: none !important;
    background: transparent !important;
    transition: opacity 0.1s ease;
    box-shadow: none !important;
}

.stamp-like {
    left: 20px;
    color: var(--accent-green);
    transform: rotate(-10deg);
    text-shadow: 0 0 15px rgba(0, 184, 101, 0.8), 0 2px 6px rgba(0, 0, 0, 0.9);
}

.stamp-dislike {
    right: 20px;
    color: var(--accent-red);
    transform: rotate(10deg);
    text-shadow: 0 0 15px rgba(255, 51, 68, 0.8), 0 2px 6px rgba(0, 0, 0, 0.9);
}

/* Play/Pause Indicator */
.play-pause-indicator {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s;
    z-index: 20;
}

.play-pause-indicator.show {
    opacity: 1;
    transform: scale(1);
}

.indicator-bubble {
    width: 60px;
    height: 60px;
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

/* Action Rail TikTok (Icônes Flottantes Sans Cadre) */
.action-rail {
    position: absolute;
    right: 12px;
    bottom: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 30;
}

.rail-btn {
    background: transparent !important;
    border: none !important;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.15s;
}

.rail-btn:active {
    transform: scale(0.88);
}

.rail-btn-icon {
    width: 36px;
    height: 36px;
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
}

.rail-btn svg {
    fill: currentColor;
}

.rail-btn-label {
    font-size: 10px;
    font-weight: 800;
    margin-top: 2px;
    color: #fff;
    font-family: var(--font-mono);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.rail-btn.liked .rail-btn-icon {
    color: var(--accent-red);
    filter: drop-shadow(0 0 10px rgba(255, 51, 68, 0.7));
}

.rail-btn.favorited .rail-btn-icon {
    color: var(--accent-gold);
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.7));
}

/* Petite image de partage (cat.jpg) et boutons JPG */
.btn-img-jpg {
    width: 24px;
    height: 24px;
    object-fit: cover;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    transition: transform 0.15s;
    vertical-align: middle;
}

.btn-img-jpg:hover {
    transform: scale(1.1);
}

.btn-deck-jpg {
    width: 38px;
    height: 38px;
    object-fit: cover;
    display: block;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9));
    transition: transform 0.15s;
}

.btn-deck-jpg:hover {
    transform: scale(1.15);
}

.btn-deck-jpg:active {
    transform: scale(0.9);
}

.btn-close-jpg {
    width: 20px;
    height: 20px;
    object-fit: cover;
    cursor: pointer;
    vertical-align: middle;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}

.btn-cat-img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    transition: transform 0.15s;
}

.btn-cat-img:hover {
    transform: scale(1.1);
}

.btn-cat-img-deck {
    width: 36px;
    height: 36px;
    object-fit: cover;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    transition: transform 0.15s;
}

/* Video Info Overlay : Textes Purs Flottants Sans Cadre */
.video-info-overlay {
    position: absolute;
    left: 0;
    right: 55px;
    bottom: 12px;
    padding: 0 14px;
    z-index: 25;
    pointer-events: none;
    background: transparent !important;
}

.raw-tag {
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
    display: block;
    margin-bottom: 2px;
}

.video-title {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 3px;
    line-height: 1.3;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

.video-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #cccccc;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

/* Timeline fine */
.video-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 35;
    cursor: pointer;
}

.video-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-red);
}

/* Contrôles Tinder : Icônes Flottantes Sans Cadre */
.tinder-deck-controls {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    display: none;
    justify-content: center;
    align-items: center;
    gap: 18px;
    z-index: 35;
}

.btn-tinder-circle {
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none !important;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9));
    transition: transform 0.15s;
}

.btn-tinder-circle:hover {
    transform: scale(1.15);
}

.btn-tinder-circle:active {
    transform: scale(0.9);
}

.btn-tinder-rewind {
    color: var(--accent-gold);
}

.btn-tinder-nope {
    color: var(--accent-red);
}

.btn-tinder-star {
    color: #38bdf8;
}
.btn-tinder-star.favorited {
    color: var(--accent-gold);
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
}

.btn-tinder-like {
    color: var(--accent-green);
}

/* Modes */
.feed-viewport.mode-tiktok .action-rail { display: flex; }
.feed-viewport.mode-tiktok .tinder-deck-controls { display: none; }

.feed-viewport.mode-tinder .action-rail { display: none; }
.feed-viewport.mode-tinder .tinder-deck-controls { display: flex; }
.feed-viewport.mode-tinder .video-card {
    inset: 0 !important;
    border: none !important;
}

/* Modales & Tiroirs Épurés */
.favorites-drawer, .catalog-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.2s;
}

.favorites-drawer.open, .catalog-modal.open {
    visibility: visible;
    pointer-events: auto;
}

.drawer-backdrop, .catalog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.2s;
}

.favorites-drawer.open .drawer-backdrop, .catalog-modal.open .catalog-backdrop {
    opacity: 1;
}

.drawer-panel, .catalog-panel {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 100%;
    background: #000000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    z-index: 10;
}

.favorites-drawer.open .drawer-panel, .catalog-modal.open .catalog-panel {
    transform: translateX(0);
}

.drawer-header, .catalog-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #222;
}

.drawer-title, .catalog-title {
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.mono-counter {
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 800;
}

.btn-close-drawer, .btn-close-catalog {
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #000;
    padding: 4px;
    cursor: pointer;
}

.fav-thumb {
    width: 60px;
    height: 75px;
    background: #000;
    object-fit: cover;
}

.fav-info {
    flex: 1;
    min-width: 0;
}

.fav-title {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.fav-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.fav-action-remove {
    color: var(--text-muted);
    padding: 6px;
}

.fav-action-remove:hover {
    color: var(--accent-red);
}

.empty-favorites {
    text-align: center;
    padding: 60px 14px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

/* Modale Catalogue */
.catalog-search-wrap {
    padding: 10px 16px;
    border-bottom: 1px solid #222;
}

.catalog-search-input {
    width: 100%;
    background: #111;
    border: none;
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    outline: none;
    font-family: var(--font-mono);
}

.catalog-items-grid {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.catalog-card-item {
    display: flex;
    gap: 12px;
    background: #000;
    cursor: pointer;
}

.catalog-card-thumb {
    width: 70px;
    height: 85px;
    background: #000;
    flex-shrink: 0;
    overflow: hidden;
}

.catalog-card-thumb-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.catalog-card-name {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.catalog-card-author {
    font-size: 11px;
    color: var(--accent-gold);
    font-weight: 700;
}

.catalog-card-sub {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    align-items: center;
}

.mono-sub-link {
    font-size: 11px;
    color: #888;
    text-decoration: underline;
}
.mono-sub-link:hover { color: #fff; }

/* Toast */
.toast-container {
    position: fixed;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: #000;
    color: #fff;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    animation: toastIn 0.2s ease, toastOut 0.2s ease 2.2s forwards;
    border: none !important;
    box-shadow: none !important;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

/* ========================================================
   PAGE GALERIE (/gallery) SANS CADRES
   ======================================================== */
.gallery-page {
    background-color: #000000;
    overflow-y: auto;
}

.gallery-container {
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #000000;
}

.gallery-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #000;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid #1a1a1a;
}

.mono-btn {
    color: #fff;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}

.mono-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
}

.title-badge .count-pill {
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 800;
}

.gallery-toolbar {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #000;
    flex-wrap: wrap;
    border-bottom: 1px solid #1a1a1a;
}

.mono-search-box {
    display: flex;
    align-items: center;
    background: #111;
    padding: 6px 10px;
    gap: 8px;
    flex: 1;
    max-width: 360px;
}

.mono-search-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 12px;
    outline: none;
    width: 100%;
    font-family: var(--font-mono);
}

.mono-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
}

.mono-sort-wrap select {
    background: #111;
    border: none;
    color: #fff;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 800;
    outline: none;
    cursor: pointer;
    font-family: var(--font-mono);
}

.gallery-grid {
    flex: 1;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.gallery-card {
    background: #000;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.15s;
}

.gallery-card:hover {
    transform: translateY(-2px);
}

.card-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #000;
    overflow: hidden;
}

.card-thumb-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-badge-cat {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 9px;
    font-weight: 800;
    color: var(--accent-gold);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.thumb-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.gallery-card:hover .thumb-hover-overlay {
    opacity: 1;
}

.play-symbol {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.card-details {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-video-name {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.card-meta-line {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.meta-author {
    color: var(--accent-gold);
    font-weight: 700;
}

.card-stats-line {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.stat-pill {
    font-size: 10px;
    font-weight: 800;
}

.pill-views {
    color: #38bdf8;
}

.pill-likes {
    color: var(--accent-red);
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-weight: 800;
}

.gallery-footer {
    padding: 14px;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    border-top: 1px solid #1a1a1a;
}
