/* Home Movies Window */
#homeMovies {
    top: 10px;
    left: 10px;
    width: 1200px;
    max-width: calc(100vw - 20px);
    height: 800px;
    max-height: calc(100vh - 60px);
    background: #ffccf1;
    display: none;
    flex-direction: column;
}

#homeMovies .window-content {
    padding: 0;
    overflow: hidden;
    flex: 1;
    background: #ffccf1;
}

/* Pages */
.hm-page {
    height: 100%;
    overflow-y: auto;
    padding: 16px;
    background: #ffccf1;
}

/* Header */
.hm-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 24px;
}

.hm-logo-img {
    height: 24px;
    width: auto;
}

.hm-filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Custom Multi-Select Dropdown */
.hm-custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 200px;
    max-width: 280px;
    flex-shrink: 1;
}

.hm-dropdown-toggle {
    background: white;
    border: 1px solid #fe81cf;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    min-height: 32px;
    width: 100%;
    box-sizing: border-box;
}

.hm-dropdown-toggle:hover {
    border-color: #fb2d9b;
}

.hm-dropdown-arrow {
    font-size: 10px;
    color: #fb2d9b;
    margin-left: 8px;
    flex-shrink: 0;
}

.hm-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #fb2d9b;
    border-radius: 4px;
    margin-top: 4px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
}

.hm-dropdown-menu.open {
    display: block;
}

.hm-dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 13px;
}

.hm-dropdown-option:hover {
    background: #ffccf1;
}

.hm-dropdown-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.hm-selected-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    overflow: hidden;
    align-items: center;
    min-height: 22px;
}

.hm-selected-tag-chip {
    background: #fb2d9b;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.hm-selected-tag-chip .remove-tag {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    font-size: 12px;
}

.hm-selected-tag-chip .remove-tag:hover {
    opacity: 1;
}

.hm-filter-btn {
    padding: 6px 16px;
    background: #fb2d9b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: background 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.hm-filter-btn:hover {
    background: #c90f72;
}

.hm-clear-btn {
    background: #ffccf1;
    color: #fb2d9b;
    border: 1px solid #fb2d9b;
}

.hm-clear-btn:hover {
    background: white;
}

/* Main Layout */
.hm-main {
    display: flex;
    gap: 24px;
}

.hm-grid-section {
    flex: 3;
    min-width: 0;
}

.hm-featured-section {
    flex: 1;
    min-width: 220px;
    max-width: 300px;
}

.hm-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    border-bottom: 2px solid #fb2d9b;
    padding-bottom: 6px;
}

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

.hm-grid-item {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hm-grid-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hm-grid-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: white;
}

.hm-grid-title {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #1e001b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
}

.hm-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #666;
    font-size: 16px;
}

/* Featured Sidebar */
.hm-featured-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hm-featured-item {
    cursor: pointer;
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.hm-featured-item:hover {
    background: #f0f0f0;
}

.hm-featured-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    background: #ddd;
}

.hm-featured-info {
    flex: 1;
    min-width: 0;
}

.hm-featured-title {
    font-size: 13px;
    font-weight: 500;
    color: #1e001b;
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: bold;
}

.hm-featured-views {
    font-size: 11px;
    color: #fb2d9b;
    margin: 0;
}

/* Player Page */
.hm-player-content {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.hm-player-left {
    flex: 2;
    min-width: 0;
}

.hm-player-right {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.hm-back-btn {
    background: none;
    border: none;
    color: #fb2d9b;
    cursor: pointer;
    font-size: 14px;
    padding: 0 0 12px 0;
    font-weight: 500;
}

.hm-back-btn:hover {
    text-decoration: underline;
}

.hm-video-wrapper {
    background: #1e001b;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    max-height: 500px;
    width: 100%;
}

.hm-video-player {
    width: 100%;
    height: 100%;
    display: block;
}

.hm-video-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e001b;
    margin: 12px 0 0 0;
}

.hm-about-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e001b;
    margin: 0 0 12px 0;
}

.hm-about-details {
    background: white;
    padding: 16px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.hm-about-date,
.hm-about-views {
    font-size: 13px;
    color: #fb2d9b;
    margin: 0 0 8px 0;
}

.hm-about-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.hm-about-tag {
    background: #fb2d9b;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
}

.hm-about-tag:hover {
    background: #c90f72;
    color: white;
}

.hm-about-description {
    font-size: 14px;
    line-height: 1.6;
    color: #1e001b;
    margin: 12px 0 0 0;
    white-space: pre-wrap;
}

/* More Videos */
.hm-more-videos {
    margin-top: 16px;
}

.hm-more-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.hm-more-item {
    cursor: pointer;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.hm-more-item:hover {
    transform: scale(1.03);
}

.hm-more-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #ddd;
}

.hm-more-title {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #1e001b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .hm-main {
        flex-direction: column;
    }
    
    .hm-featured-section {
        max-width: 100%;
        min-width: 0;
    }
    
    .hm-featured-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .hm-player-content {
        flex-direction: column;
    }
    
    .hm-player-right {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .hm-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .hm-more-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .hm-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hm-filter-bar {
        flex-wrap: wrap;
    }
    
    .hm-tag-select {
        flex: 1;
        min-width: 100px;
    }
}