:root {
    --bg: #09090b;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --accent: #ffffff;
    --glass: rgba(15, 15, 18, 0.65);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg);
    color: var(--text);
    padding-top: 80px; /* miejsce na navbar */
    overflow-x: hidden;
}

/* Navbar (Apple style glass) */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    padding: 0 5%;
    z-index: 50;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 2rem;
    letter-spacing: -0.5px;
}

.breadcrumbs {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Eksplorator */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem 5%;
}

.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255,255,255,0.02);
}

.card:hover {
    transform: scale(1.05);
    background: var(--surface-hover);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card .icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.card .title {
    width: 100%;
    text-align: center;
    font-weight: 500;
    font-size: 1rem;
    /* To ucina tekst i dodaje ... */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal Playera */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.player-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#main-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Interfejs playera */
.player-ui {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 20%, transparent 80%, rgba(0,0,0,0.8) 100%);
    transition: opacity 0.4s ease;
}

.player-ui.idle {
    opacity: 0;
    cursor: none;
}

.top-controls {
    display: flex;
    justify-content: flex-end;
}

.glass-panel {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

#time-current, #time-total {
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.spacer {
    flex-grow: 1;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
    color: var(--accent);
}

.play-btn {
    font-size: 2rem;
}

/* Customowy suwak Apple/Netflix style */
input[type=range] {
    -webkit-appearance: none;
    flex-grow: 1;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    position: relative;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

input[type=range]:hover::-webkit-slider-thumb {
    transform: scale(1.3);
}

::cue {
    color: #eab308; /* Fajny, kinowy żółty (możesz zmienić na white) */
    background-color: rgba(0, 0, 0, 0.7); /* Półprzezroczyste czarne tło */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    border-radius: 4px; /* Zaokrąglenie tła */
}

#sub-overlay {
    z-index: 9999 !important;
    pointer-events: none;
    
    /* Wygląd */
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 2.2rem !important; /* Większe i wyraźniejsze */
    font-weight: 600;
    color: #ffffff;
    
    /* Profesjonalny efekt kinowy */
    text-shadow: 
        0px 0px 4px rgba(0, 0, 0, 1), 
        0px 0px 8px rgba(0, 0, 0, 1), 
        2px 2px 2px rgba(0, 0, 0, 0.8);
    
    /* Odstępy i wyrównanie */
    line-height: 1.3;
    padding: 0 10%; /* Napisy nie będą dotykać krawędzi ekranu */
    
    /* Płynne wejście */
    transition: opacity 0.2s ease-in-out;
}

#breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-family: Arial, sans-serif;
}

#breadcrumbs span {
    color: #fff;
    font-size: 14px;
}

#convert-btn {
    background: #1f1f1f;
    color: #fff;
    border: 1px solid #333;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
}

#convert-btn:hover {
    background: #2a2a2a;
    transform: scale(1.05);
}

#convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#convert-status {
    color: #aaa;
    font-size: 12px;
    margin-left: 4px;
}

.card {
    transition: 0.2s;
}

.card:hover {
    transform: scale(1.03);
}