/* ── Movies Plugin ── */

.movies-page {
    max-width: 1200px;
    margin: 0 auto;
}

/* Toolbar */
.movies-toolbar {
    margin-bottom: 20px;
}

.movies-search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.movies-search-input {
    flex: 1 1 200px;
    min-width: 160px;
    padding: 7px 12px;
}

.movies-collection-select,
.movies-sort-select {
    padding: 7px 8px;
}

.movies-search-btn {
    padding: 7px 16px;
    cursor: pointer;
}

/* Grid */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.movies-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    transition: transform 0.15s, box-shadow 0.15s;
}

.movies-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.movies-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.movies-card-poster {
    position: relative;
    width: 100%;
    padding-top: 140%;
    background: #1a1a2e;
    overflow: hidden;
}

.movies-card-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movies-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.movies-card:hover .movies-card-play {
    opacity: 1;
}

.movies-card-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    pointer-events: none;
}

.movies-card-body {
    padding: 10px 12px 14px;
}

.movies-card-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movies-card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.movies-card-year {
    font-size: 12px;
    color: #888;
}

.movies-card-rating {
    font-size: 12px;
    color: #e8a100;
}

.movies-card-creator {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Player overlay */
.movies-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.movies-player-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
}

.movies-player-wrap {
    position: relative;
    width: 90%;
    max-width: 960px;
    background: #111;
    border-radius: 10px;
    overflow: hidden;
    z-index: 1;
}

.movies-player-close {
    position: absolute;
    top: 10px;
    right: 16px;
    color: #fff;
    font-size: 28px;
    text-decoration: none;
    z-index: 2;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.movies-player-close:hover {
    opacity: 1;
    color: #fff;
}

.movies-player-title-bar {
    padding: 14px 50px 14px 18px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #1a1a2e;
}

.movies-player {
    width: 100%;
    max-height: 70vh;
    background: #000;
    display: block;
}

.movies-player-info {
    padding: 10px 18px 14px;
    color: #aaa;
    font-size: 12px;
}

.movies-version-select {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    margin-left: 6px;
    cursor: pointer;
}

.movies-version-select:hover {
    border-color: #888;
}

/* Pagination */
.movies-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
    font-size: 14px;
}

.movies-page-link {
    padding: 6px 14px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
}

.movies-page-link:hover {
    background: #ddd;
    color: #333;
}

.movies-page-info {
    color: #888;
}

/* Empty state */
.movies-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 15px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .movies-search-form {
        flex-direction: column;
    }

    .movies-search-input,
    .movies-collection-select,
    .movies-sort-select,
    .movies-search-btn {
        width: 100%;
        flex: none;
    }

    .movies-search-btn {
        background-repeat: no-repeat;
        background-position: 12px center;
        background-size: 16px 16px;
    }

    .movies-player-wrap {
        width: 98%;
    }
}
