/* ========== GENERAL ========== */
body {
    font-family: Arial, sans-serif;
    background: #121212;
    color: #fff;
    margin: 0;
    padding: 0;
}

header {
    background: #1e1e1e;
    color: #fff;
    padding: 15px 20px;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    position: relative;
}

h1 {
    margin: 0;
    font-size: 2em;
}

/* Search bar */
#search-bar {
    display: flex;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

#query {
    width: 350px;
    padding: 10px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    outline: none;
    background-color: #121212; /*#1f1f1f*/
    color: #eee;
}

#query::placeholder {
    color: #888;
}

#results, #history {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px 20px 20px 20px;
}

/* Tile */
.tile {
    position: relative;
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #fff;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

/* Poster box */
.poster-box {
    position: relative;
    width: 100%;
    height: 300px;
    background: #2a2a2a;
    overflow: hidden;
}

.poster-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-skeleton {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    position: absolute;
    top: 0;
    left: 0;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Badges */
.type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(246, 149, 39, 255);
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
}

.imdb-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
}

/* Info under poster */
.info {
    padding: 10px;
    text-align: center;
}

.info h3 {
    margin: 0;
    font-size: 1.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.info p {
    margin: 5px 0 0;
    font-size: 0.9em;
    color: #ccc;
}

.info .year {
    font-size: 0.85em;
    color: #999;
    margin-top: 2px;
}

/* No result */
.no-results {
    text-align: center;
    color: #777;
    font-size: 1.2em;
    margin-top: 50px;
}

/* Delete button inside tile */
.delete-history {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(246, 149, 39, 255);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tile:hover .delete-history {
    opacity: 1;
    pointer-events: auto;
}

.logo {
    height: 40px;
    width: auto;
    display: block;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.logo:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.site-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    letter-spacing: 1px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}