/**
 * IPTV Hero Search Section Styles
 * Full-screen immersive search interface (90vh height)
 */

/* ===== Hero Search Section ===== */
.iptv-hero-search-section {
    background: linear-gradient(135deg, #141414 0%, #1f1f1f 100%);
    /* 更深邃的高级黑背景 */
    height: 70vh;
    /* 占据视口90%高度 */
    min-height: 600px;
    /* 保证最小高度 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* 垂直居中 */
    align-items: center;
    /* 水平居中 */
    padding: 0 40px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #333;
    box-sizing: border-box;
}

.iptv-hero-content {
    width: 100%;
    max-width: 1000px;
    /* 增加内容宽度 */
    margin: 0 auto;
    transform: translateY(-20px);
    /* 视觉上稍微向上提一点，更平衡 */
}

.iptv-hero-title {
    font-size: 64px;
    /* 超大标题 */
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 30px 0;
    line-height: 1.1;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.iptv-hero-description {
    font-size: 24px;
    color: #fff;
    margin: 0 auto 60px auto;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ===== Search Wrapper ===== */
.iptv-search-wrapper {
    width: 100%;
    max-width: 800px;
    /* 更宽的搜索区域 */
    margin: 0 auto;
}

.iptv-search-label {
    font-size: 28px;
    color: #fff;
    margin: 20px 0 0 0;
    font-weight: 500;
    letter-spacing: 1px;
}

/* ===== Hero Search Box ===== */
.iptv-hero-search-form {
    width: 100%;
}

.iptv-hero-search-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    /* 半透明背景 */
    border: 3px solid #dc3545;
    /* 更粗的边框 */
    border-radius: 12px;
    /* 更大的圆角 */
    padding: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    /* 毛玻璃效果 */
}

.iptv-hero-search-box:focus-within {
    border-color: #ff4757;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(220, 53, 69, 0.2);
    transform: translateY(-2px);
}

.iptv-search-icon {
    font-size: 28px;
    /* 更大的图标 */
    padding: 0 20px;
    color: #888;
    pointer-events: none;
}

.iptv-hero-search-input {
    flex: 1;
    background: transparent !important;
    ;
    border: none !important;
    ;
    outline: none;
    padding: 20px 10px;
    font-size: 22px;
    /* 更大的输入文字 */
    color: #ffffff;
    font-weight: 500;
    height: auto;
}

.iptv-hero-search-input::placeholder {
    color: #666;
    font-style: normal;
    font-weight: 400;
}

.iptv-search-clear-btn {
    padding: 12px 24px;
    background: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iptv-search-clear-btn:hover {
    background: #ff4757;
    transform: scale(1.05);
}

/* ===== Search Results Banner (Floating) ===== */
.iptv-search-results-banner {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 45, 45, 0.9);
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid #444;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #ffffff;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.iptv-results-icon {
    font-size: 18px;
}

.iptv-search-results-banner strong {
    color: #ff4757;
    font-weight: 600;
}

.iptv-clear-link {
    margin-left: 10px;
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px dotted #aaa;
    transition: all 0.3s ease;
}

.iptv-clear-link:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* ===== Categorized View Header ===== */
.iptv-categorized-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    margin: 30px auto;
    border-bottom: 1px solid #333;
    max-width: 1200px;
}

.iptv-categorized-title {
    font-size: 16px;
    font-weight: 800;
    color: #666;
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
}

.iptv-categorized-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.iptv-expand-all-btn,
.iptv-collapse-all-btn {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.iptv-expand-all-btn:hover,
.iptv-collapse-all-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.iptv-control-separator {
    color: #444;
    font-size: 14px;
}

/* ===== Category Groups (New Dark Card Style) ===== */
.iptv-category-groups {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.iptv-category-group {
    margin-bottom: 15px;
    border-radius: 12px;
    background: #111;
    border: 1px solid #222;
    overflow: hidden;
    transition: all 0.3s ease;
}

.iptv-category-group:hover {
    border-color: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.iptv-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    background: #141414;
    transition: background 0.2s;
}

.iptv-category-header:hover {
    background: #1a1a1a;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.category-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.channel-count {
    background: #222;
    color: #888;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #333;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.iptv-category-group:not(.collapsed) .toggle-btn {
    color: #fff;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .iptv-hero-title {
        font-size: 52px;
    }

    .iptv-hero-description {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .iptv-hero-search-section {
        height: auto;
        min-height: 80vh;
        padding: 60px 20px;
    }

    .iptv-hero-title {
        font-size: 42px;
    }

    .iptv-hero-description {
        font-size: 18px;
        margin-bottom: 40px;
    }

    .iptv-hero-search-box {
        flex-direction: column;
        padding: 10px;
    }

    .iptv-hero-search-input {
        padding: 15px;
        text-align: center;
        font-size: 18px;
        width: 100%;
    }

    .iptv-search-icon {
        display: none;
        /* 移动端隐藏图标以节省空间 */
    }

    .iptv-search-clear-btn {
        width: 100%;
        margin: 10px 0 0 0;
    }
}

@media (max-width: 480px) {
    .iptv-hero-title {
        font-size: 32px;
    }

    .iptv-hero-description {
        font-size: 16px;
    }

    .iptv-hero-search-input {
        font-size: 16px;
    }
}

/* ===== Animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.iptv-hero-content {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===== Toggle/Collapse Functionality ===== */
.iptv-category-group.collapsed .iptv-category-content {
    display: none;
}

.iptv-category-group.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* ===== Category Filter Select ===== */
.iptv-category-select {
    background: #1a1a1a !important;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 35px 8px 15px;
    /* Right padding for arrow */
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    min-width: 220px;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23dc3545%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
}

.iptv-category-select:hover,
.iptv-category-select:focus {
    margin: 0 auto;
    padding: 0 20px;
}

.iptv-category-group {
    margin-bottom: 15px;
    border-radius: 12px;
    background: #111;
    border: 1px solid #222;
    overflow: hidden;
    transition: all 0.3s ease;
}

.iptv-category-group:hover {
    border-color: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.iptv-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    background: #141414;
    transition: background 0.2s;
}

.iptv-category-header:hover {
    background: #1a1a1a;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.category-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.channel-count {
    background: #222;
    color: #888;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #333;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.iptv-category-group:not(.collapsed) .toggle-btn {
    color: #fff;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .iptv-hero-title {
        font-size: 52px;
    }

    .iptv-hero-description {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .iptv-hero-search-section {
        height: auto;
        min-height: 80vh;
        padding: 60px 20px;
    }

    .iptv-hero-title {
        font-size: 42px;
    }

    .iptv-hero-description {
        font-size: 18px;
        margin-bottom: 40px;
    }

    .iptv-hero-search-box {
        flex-direction: column;
        padding: 10px;
    }

    .iptv-hero-search-input {
        padding: 15px;
        text-align: center;
        font-size: 18px;
        width: 100%;
    }

    .iptv-search-icon {
        display: none;
        /* 移动端隐藏图标以节省空间 */
    }

    .iptv-search-clear-btn {
        width: 100%;
        margin: 10px 0 0 0;
    }
}

@media (max-width: 480px) {
    .iptv-hero-title {
        font-size: 32px;
    }

    .iptv-hero-description {
        font-size: 16px;
    }

    .iptv-hero-search-input {
        font-size: 16px;
    }
}

/* ===== Animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.iptv-hero-content {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===== Toggle/Collapse Functionality ===== */
.iptv-category-group.collapsed .iptv-category-content {
    display: none;
}

.iptv-category-group.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* ===== Category Filter Select ===== */
.iptv-category-select {
    background: #1a1a1a !important;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 35px 8px 15px;
    /* Right padding for arrow */
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    min-width: 220px;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23dc3545%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
}

.iptv-category-select:hover,
.iptv-category-select:focus {
    border-color: #dc3545;
    background-color: #222;
    color: #fff;
}

.iptv-category-select option {
    background: #1a1a1a;
    color: #fff;
    padding: 10px;
}

/* Search Results List Layout */
.iptv-search-results-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
}

.iptv-search-result-item {
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 20px;
    transition: background 0.2s;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.iptv-dark-mode .iptv-search-result-item {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    box-shadow: none;
}

.iptv-result-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

.iptv-dark-mode .iptv-result-icon {
    background: #333;
    border-color: #444;
}

.iptv-result-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iptv-result-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #888;
}

.iptv-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.iptv-result-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.iptv-dark-mode .iptv-result-name {
    color: #fff;
}

.iptv-result-category {
    font-size: 14px;
    color: #888;
    display: flex;
    align-items: center;
}

.iptv-result-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.iptv-provider-name {
    color: #888;
    font-size: 14px;
}

.iptv-status-badge {
    background: #00b894;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.iptv-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border: 1px solid #4a90e2;
    color: #4a90e2;
    background: transparent;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.iptv-view-btn:hover {
    background: #4a90e2;
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .iptv-search-result-item {
        flex-wrap: wrap;
    }

    .iptv-result-meta {
        width: 100%;
        margin-top: 15px;
        justify-content: space-between;
    }
}