/**
 * HTML5 720p Player - Stylesheet
 * All classes prefixed with html5p- to avoid conflicts with phpBB styles
 *
 * @package bax/html5720player
 */

/* === CARD WRAPPER === */
.html5p-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.10);
    margin: 20px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: box-shadow 0.3s ease;
}

.html5p-card:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

/* === TITLE BAR === */
.html5p-title {
    padding: 14px 18px;
    background: #1a2a6c;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
}

/* === MAIN LAYOUT === */
.html5p-content {
    display: flex;
    flex-direction: row;
    gap: 18px;
    padding: 15px;
    min-height: 380px;
    box-sizing: border-box;
}

/* === VIDEO SIDE === */
.html5p-video-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.html5p-player-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.html5p-player-container video {
    width: 100%;
    max-width: 720px;
    max-height: 405px;
    height: auto;
    border-radius: 8px;
    background: #000;
    object-fit: contain;
    display: block;
}

/* Loading overlay */
.html5p-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    z-index: 10;
    border-radius: 8px;
}

.html5p-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: html5p-spin 0.9s linear infinite;
    margin-bottom: 10px;
}

@keyframes html5p-spin {
    to { transform: rotate(360deg); }
}

/* === SUBTITLE CONTROLS === */
.html5p-subtitle-controls {
    margin-top: 14px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.html5p-imdb-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.html5p-imdb-input {
    flex: 1;
    min-width: 140px;
    padding: 9px 13px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.html5p-imdb-input:focus {
    border-color: #1a2a6c;
}

.html5p-search-btn {
    padding: 9px 18px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.html5p-search-btn:hover  { background: #45a049; }
.html5p-search-btn:disabled {
    background: #bbb;
    cursor: not-allowed;
}

.html5p-source-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}

.html5p-source-opt {
    padding: 6px 13px;
    background: #e9ecef;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    user-select: none;
}

.html5p-source-opt:hover { background: #dde2e6; }

.html5p-source-opt.active {
    background: #1a2a6c;
    color: #fff;
    border-color: #1a2a6c;
}

.html5p-sub-info {
    padding: 10px 12px;
    background: #e6f3fb;
    border-left: 4px solid #1a2a6c;
    border-radius: 5px;
    color: #1a2a6c;
    font-size: 0.9rem;
    margin-bottom: 8px;
    word-break: break-word;
}

.html5p-sub-info .html5p-active-sub {
    font-weight: 700;
}

.html5p-status {
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    min-height: 20px;
}

.html5p-status.success {
    background: #dff0d8;
    color: #3c763d;
    border: 1px solid #d0e9c6;
}

.html5p-status.error {
    background: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

.html5p-status.info {
    background: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
}

/* === INFO SIDE === */
.html5p-info-container {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
}

.html5p-info-box {
    flex: 1;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow-y: auto;
    max-height: 520px;
    font-size: 0.9rem;
    color: #444;
}

.html5p-info-box h3 {
    margin-bottom: 10px;
    color: #1a2a6c;
    border-bottom: 2px solid #1a2a6c;
    padding-bottom: 5px;
    font-size: 1rem;
}

.html5p-info-box p {
    margin-bottom: 7px;
    line-height: 1.5;
}

.html5p-poster-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
}

.html5p-poster {
    max-width: 190px;
    border-radius: 7px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    display: none;
}

.html5p-no-poster {
    width: 190px;
    height: 280px;
    background: #ddd;
    border-radius: 7px;
    display: none;
    text-align: center;
    line-height: 280px;
    color: #888;
    font-size: 0.85rem;
}

.html5p-poster-status {
    font-size: 0.78rem;
    color: #888;
    margin-top: 3px;
}

.html5p-year-rating {
    font-weight: bold;
    color: #4CAF50;
}

.html5p-plot {
    font-style: italic;
    color: #555;
    border-left: 3px solid #1a2a6c;
    padding: 8px 10px;
    margin: 8px 0;
    background: #eef2f8;
    border-radius: 4px;
}

.html5p-imdb-link {
    display: none;
    margin-top: 10px;
    padding: 7px 14px;
    background: #f5c518;
    color: #000 !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.html5p-imdb-link:hover { background: #d4ac0c; }

/* === RESPONSIVE === */
@media (max-width: 1050px) {
    .html5p-content {
        flex-direction: column;
        min-height: auto;
    }
    .html5p-info-container {
        flex: 0 0 auto;
        width: 100%;
    }
}

@media (max-width: 700px) {
    .html5p-player-container video {
        max-height: 280px;
    }
    .html5p-source-options {
        flex-direction: column;
    }
    .html5p-imdb-row {
        flex-direction: column;
        align-items: stretch;
    }
}
