:root {
    --primary-color: #00a8ff;
    --text-color: #ffffff;
    --bg-color: #1a1a1a;
    --controls-bg: rgba(20, 20, 20, 0.8);
    --header-height: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Share Tech", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-top: var(--header-height);
}

body.modal-open {
    overflow: hidden;
}

a {
    text-decoration: none;
}


#results-info {
    max-width: 1400px;
    margin: 1.5rem auto 0 auto;
    padding: 0.75rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    background-color: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 1.2em;
    line-height: 1.5;
}

#results-info strong {
    color: var(--text-color);
    font-weight: 600;
}

#results-info code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

#results-info a {
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
}
    .error-page-container {
        padding: 2rem 1.5rem;
        margin: 2rem auto;
    }

    .error-code {
        font-size: 6rem;
    }

    .error-title {
        font-size: 1.8rem;
    }

    .error-message {
        font-size: 1rem;
    }

main {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

footer {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--text-color);
    text-align: center;
    padding: 12px;
    margin-top: 2rem;
}

#createPlayerBtn {
    padding: 12px 24px;
    font-size: 1.1rem;
    cursor: pointer;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease;
    font-family: "Share Tech", sans-serif;
}

#createPlayerBtn:hover {
    background-color: #007bb5;
}

#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--controls-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    gap: 15px;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

#main-header.header-hidden {
    transform: translateY(-100%);
}

.search-form {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

#menu-toggle-btn,
#filter-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    position: relative;
    flex-shrink: 0;
}

.filter-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: none;
}

.filter-indicator.active {
    display: block;
}

.search-input-wrapper {
    flex-grow: 1;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: 1px solid #555;
    background-color: #333;
    color: var(--text-color);
    font-family: "Share Tech", sans-serif;
    font-size: 1rem;
}

#search-submit-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    font-size: 1rem;
    cursor: pointer;
    padding: 10px;
}

#live-search-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background-color: #2a2a2a;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

#live-search-results.visible {
    display: block;
}

.live-search-item {
    display: flex;
    align-items: center;
    padding: 8px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid #444;
    text-align: left;
}

.live-search-item:last-child {
    border-bottom: none;
}

.live-search-item:hover {
    background-color: #444;
}

.live-search-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 4px;
    flex-shrink: 0;
}

.live-search-item-info {
    display: flex;
    flex-direction: column;
}

.live-search-item-title {
    font-weight: bold;
}

.live-search-item-type {
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    align-self: flex-start;
}

.live-search-item-type[data-type="movies"] {
    background-color: #2980b9;
}

.live-search-item-type[data-type="series"] {
    background-color: #27ae60;
}

.live-search-item-type[data-type="xxx"] {
    background-color: #c0392b;
}

.modal-hidden {
    display: none !important;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1010;
}

.filter-panel,
.menu-panel {
    position: fixed;
    z-index: 1011;
    background-color: #2a2a2a;
    transition: transform 0.3s ease-in-out;
}

.menu-panel {
    left: 0;
    top: 0;
    height: 100%;
    width: 280px;
    transform: translateX(-100%);
    border-right: 1px solid #444;
}

.menu-panel ul {
    list-style: none;
    padding: 20px 0;
}

.menu-panel li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
}

.menu-panel li a:hover {
    background-color: #444;
}

.menu-panel li a i {
    width: 20px;
    text-align: center;
}

.filter-panel {
    right: 0;
    top: 0;
    height: 100%;
    width: 320px;
    transform: translateX(100%);
    display: flex;
    flex-direction: column;
}

#menu-modal:not(.modal-hidden) .menu-panel,
#filter-modal:not(.modal-hidden) .filter-panel {
    transform: translateX(0);
}

.filter-header,
.filter-footer {
    padding: 15px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.filter-footer {
    border-bottom: none;
    border-top: 1px solid #444;
    gap: 10px;
}

#filter-close-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.filter-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: bold;
}

.filter-group select {
    width: 100%;
    padding: 10px;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 5px;
    font-family: "Share Tech", sans-serif;
    font-size: 1rem;
}

#filter-apply-btn,
#filter-reset-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: "Share Tech", sans-serif;
    flex-grow: 1;
}

#filter-apply-btn {
    background-color: var(--primary-color);
    color: white;
}

#filter-reset-btn {
    background-color: #555;
    color: white;
}

#jump-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#jump-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background-color: var(--controls-bg);
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    opacity: 0;
    transform: translateY(20px);
    animation: toast-fade-in-out 3s ease-in-out forwards;
}

@keyframes toast-fade-in-out {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    15% {
        opacity: 1;
        transform: translateY(0);
    }

    85% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    overflow: hidden;
    border-radius: 8px;
}

.video-player.fullscreen {
    max-width: 100%;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.video-player video {
    width: 100%;
    height: 100%;
    display: block;
}

.ad-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 100;
    display: none;
}

.ad-container.visible {
    display: block;
}

.ad-video {
    width: 100%;
    height: 100%;
}

.ad-click-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.ad-ui {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.ad-countdown {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.ad-mute-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    pointer-events: auto;
}

.ad-skip-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    pointer-events: auto;
    display: none;
}

.ad-icon {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 101;
    pointer-events: none;
}


.custom-subtitle-display {
    position: absolute;
    bottom: 65px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 90%;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 1.2rem;
    text-align: center;
    z-index: 1;
    pointer-events: none;
    transition: bottom 0.3s ease-in-out;
}

.custom-subtitle-display:empty {
    display: none;
}

.video-player.controls-hidden .custom-subtitle-display {
    bottom: 20px;
}

.tap-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 50px);
    display: flex;
    z-index: 1;
}

.tap-zone {
    width: 50%;
    height: 100%;
}

.seek-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.5);
    color: rgba(255, 255, 255, 0.8);
    font-size: 48px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.seek-indicator.left {
    left: 25%;
}

.seek-indicator.right {
    right: 25%;
}

.seek-indicator.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.controls-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: var(--text-color);
    z-index: 2;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.video-player.controls-hidden .controls-container {
    opacity: 0;
    pointer-events: none;
}

.timeline-container {
    height: 10px;
    margin: 0 10px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 0;
    margin-top: -10px;
}

.timeline {
    background-color: rgba(255, 255, 255, 0.3);
    height: 5px;
    width: 100%;
    position: relative;
    border-radius: 5px;
}

.timeline .progress {
    background-color: var(--primary-color);
    width: 0%;
    height: 100%;
    border-radius: 5px;
    transition: none;
}

.video-player:not(.scrubbing):not(.hovering) .progress {
    transition: width 0.1s linear;
}

.timeline .thumb-indicator {
    position: absolute;
    height: 14px;
    width: 14px;
    background-color: var(--primary-color);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    display: none;
}

.timeline-container:hover .thumb-indicator,
.video-player.scrubbing .thumb-indicator {
    display: block;
}

.timeline-thumbnail {
    position: absolute;
    bottom: 30px;
    border: 2px solid white;
    border-radius: 3px;
    transform: translateX(-50%);
    display: none;
    width: 160px;
    height: 90px;
    background-size: cover;
    background-position: center;
}

.timeline-container:hover .timeline-thumbnail,
.video-player.scrubbing .timeline-thumbnail {
    display: block;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
}

.controls button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.volume-container {
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: width 0.2s ease-in-out, transform 0.2s ease-in-out;
    cursor: pointer;
}

.volume-container:hover .volume-slider {
    width: 80px;
    transform: scaleX(1);
    margin: 0 5px;
}

.time-container {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.video-player.controls-hidden .controls-container,
.video-player.controls-hidden .time-container {
    opacity: 0;
    pointer-events: none;
}

.settings-menu {
    position: absolute;
    bottom: 50px;
    right: 10px;
    background-color: var(--controls-bg);
    border-radius: 5px;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 200px;
    z-index: 3;
}

.settings-menu.active {
    display: flex;
}

.settings-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-menu-item select {
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 3px;
    padding: 3px;
    font-family: "Share Tech", sans-serif;
}

.save-prefs-btn {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-family: "Share Tech", sans-serif;
}

.save-prefs-btn:hover {
    background-color: #007bb5;
}

.error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--error-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    padding: 20px;
}

.error-overlay p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.error-overlay .reload-btn {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-family: "Share Tech", sans-serif;
}

.error-overlay .reload-btn:hover {
    background-color: #007bb5;
}

@media (max-width: 600px) {
    .volume-slider {
        width: 60px;
    }

    .time-container {
        font-size: 12px;
    }

    .controls button {
        font-size: 18px;
    }

    .timeline-thumbnail {
        width: 120px;
        height: 67.5px;
    }

    .custom-subtitle-display {
        font-size: 1rem;
        bottom: 55px;
    }

    .video-player.controls-hidden .custom-subtitle-display {
        bottom: 15px;
    }
}