/* --- RESET I PODSTAWY --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --app-bg: #000000;
    --accent-pink: #ec4899;
    --accent-violet: #8b5cf6;
    --glass-bg: rgba(18, 18, 18, 0.8);
    --nav-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom);
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--app-bg);
    color: white;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden; /* Blokuje scroll całego body */
    overscroll-behavior-y: none; /* Blokuje pull-to-refresh na Android/iOS */
}

/* --- MECHANIKA TIKTOKA (FEED) --- */
.feed-container {
    height: 100dvh; /* Dynamiczna wysokość (uwzględnia paski przeglądarki) */
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Ukrywanie scrollbara */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.media-card {
    height: 100dvh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always; /* Zmusza do zatrzymania na każdym filmie */
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- MEDIA (VIDEO/IMAGE) --- */
.video-player, 
.media-card img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Zachowuje proporcje bez ucinania */
    z-index: 10;
}

/* Gradient tła (aby tekst był czytelny) */
.media-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        0deg, 
        rgba(0,0,0,0.8) 0%, 
        rgba(0,0,0,0) 40%, 
        rgba(0,0,0,0) 60%, 
        rgba(0,0,0,0.4) 100%
    );
    z-index: 20;
    pointer-events: none;
}

/* --- NAKŁADKA UI: INFO (Dół-Lewo) --- */
.ui-info-overlay {
    position: absolute;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    left: 16px;
    right: 80px; /* Miejsce na przyciski boczne */
    z-index: 40;
    pointer-events: none;
}

.ui-info-overlay * {
    pointer-events: auto; /* Pozwala klikać w tekst/linki wewnątrz overlay */
}

.author-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.author-name {
    font-weight: 800;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: -0.02em;
}

.media-description {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #f4f4f5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* --- NAKŁADKA UI: AKCJE (Bok-Prawo) --- */
.side-actions {
    position: absolute;
    right: 12px;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 24px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.action-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    transition: transform 0.2s active;
}

.action-btn i {
    font-size: 32px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
    margin-bottom: 4px;
}

.action-btn span {
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* --- DOLNE MENU (NAVBAR) --- */
.mobile-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: calc(var(--nav-height) + var(--safe-bottom));
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-bottom);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #71717a;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-item.active {
    color: white;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Przycisk Dodaj (+) */
.add-btn-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    top: -10px;
}

.add-btn {
    width: 50px;
    height: 38px;
    background: white;
    color: black;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
    transition: transform 0.2s;
}

.add-btn:active {
    transform: scale(0.9);
}

/* --- ANIMACJE I EFEKTY --- */
@keyframes heart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.liked i {
    color: #ef4444;
    animation: heart-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Styl dla ładowania AI / generowania wideo */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* HIGHLIGHTS SPECIFIC */
.highlight-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent-pink);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

/* NA TO: */
.video-player, .content-obj {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Nowy styl tylko dla awatarów */
.avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* To wypełni całe kółko */
    display: block;
}

/* --- ANIMACJA DUŻEGO SERCA (DOUBLE TAP) --- */
.big-heart-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 60;
    pointer-events: none; /* Nie blokuje kliknięć */
    opacity: 0;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 0 15px rgba(0,0,0,0.3));
	color: red;
}

.animate-big-heart {
    animation: big-heart-animation 0.7s ease-out;
}

@keyframes big-heart-animation {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Płynne przejścia */
#heartCounter {
	transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border 0.3s;
}
#bigTimer {
	text-shadow: 0 0 40px rgba(219, 39, 119, 0.3); /* Delikatna poświata pink-600 */
}

video::-webkit-media-controls-enclosure { display:none !important; }