* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #0f172a;
    color: #f8fafc;
    overflow: hidden; /* Blokujemy przewijanie na ekranie swipowania */
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Typografia i kolory */
.highlight { color: #10b981; }
h1, h2 { text-align: center; margin-bottom: 20px; }

/* Ekrany */
.screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity 0.3s ease;
    z-index: 10;
    background-color: #0f172a;
}
.hidden { opacity: 0; pointer-events: none; z-index: -1; }
.active { opacity: 1; pointer-events: auto; }

/* Przyciski i formularze */
.actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    margin-bottom: 15px;
    transition: transform 0.2s, background-color 0.2s;
}
.btn.primary { background-color: #10b981; color: white; }
.btn.primary:hover { background-color: #059669; transform: scale(1.05); }
.btn.secondary { background-color: #334155; color: white; }
.btn.secondary:hover { background-color: #475569; transform: scale(1.05); }

input[type="text"] {
    width: 100%; max-width: 300px;
    padding: 15px; border-radius: 10px;
    border: 2px solid #334155;
    background-color: #1e293b; color: white;
    font-size: 1.2rem; text-align: center;
    margin-bottom: 15px; text-transform: uppercase;
}

.divider { margin: 15px 0; color: #64748b; font-size: 0.9rem; }

/* Nawigacja */
#navbar {
    position: fixed; top: 0; left: 0; width: 100%;
    padding: 15px 20px; display: flex;
    justify-content: space-between; align-items: center;
    z-index: 100; background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
}
.session-info { font-size: 0.9rem; color: #94a3b8; }
#btn-liked {
    background: none; border: none;
    color: #f43f5e; font-size: 1.5rem; cursor: pointer;
}

/* Siatka gatunków */
.genre-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px;
    width: 100%; max-width: 400px;
}
.genre-btn {
    padding: 20px; background-color: #1e293b;
    border: 2px solid transparent; border-radius: 15px;
    color: white; font-size: 1.1rem; font-weight: bold;
    cursor: pointer; transition: 0.3s;
}
.genre-btn:hover { border-color: #10b981; background-color: #334155; }

.huge-code { font-size: 4rem; letter-spacing: 5px; color: #10b981; margin: 20px 0; }
.loader { border: 4px solid #334155; border-top: 4px solid #10b981; border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; margin-top: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Karty Filmów */
#card-container {
    position: relative; width: 100%; max-width: 400px;
    height: 60vh; margin-top: 50px; perspective: 1000px;
}
.movie-card {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #1e293b; border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}
.movie-poster {
    width: 100%; height: 65%; object-fit: cover;
}
.movie-info { padding: 15px; height: 35%; display: flex; flex-direction: column; }
.movie-title { font-size: 1.3rem; margin-bottom: 5px; text-align: left; }
.movie-desc { font-size: 0.9rem; color: #cbd5e1; overflow-y: auto; flex-grow: 1; margin-bottom: 10px; }
.btn-trailer {
    background-color: #eab308; color: #1e293b; border: none;
    padding: 8px; border-radius: 10px; font-weight: bold; cursor: pointer;
}

/* Efekty Swipowania */
.swipe-left { transform: translateX(-150%) rotate(-20deg); opacity: 0; }
.swipe-right { transform: translateX(150%) rotate(20deg); opacity: 0; }

/* Kontrolki na dole */
.controls { display: flex; gap: 30px; margin-top: 30px; }
.control-btn {
    width: 70px; height: 70px; border-radius: 50%;
    border: none; font-size: 2rem; cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); transition: transform 0.2s;
}
.control-btn:hover { transform: scale(1.1); }
.control-btn.nope { background-color: #1e293b; color: #f43f5e; border: 2px solid #f43f5e; }
.control-btn.like { background-color: #1e293b; color: #10b981; border: 2px solid #10b981; }

/* Modale (Trailer i Match) */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 200;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.3s ease;
}
.modal-content {
    background: #1e293b; padding: 30px; border-radius: 20px;
    width: 90%; max-width: 500px; text-align: center; position: relative;
}
.close-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
.iframe-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin-top: 15px;}
.iframe-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 10px;}

/* Match ekran */
.match-heart { color: #f43f5e; animation: pulse 1s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
#match-poster { width: 60%; border-radius: 10px; margin: 20px 0; box-shadow: 0 0 30px rgba(16, 185, 129, 0.5); }

/* Ekran Polubionych */
.liked-header { display: flex; align-items: center; width: 100%; padding: 20px; margin-bottom: 20px;}
#btn-back-to-swipe { background: none; border: none; color: white; font-size: 1.1rem; cursor: pointer; margin-right: auto;}
.liked-list { width: 100%; max-width: 500px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; padding-bottom: 20px;}
.liked-item { display: flex; align-items: center; background: #1e293b; padding: 10px; border-radius: 10px; gap: 15px;}
.liked-item img { width: 50px; border-radius: 5px; }