/* M3U Generator Section */

.m3u-animated-item {
    opacity: 0;
    transform: translateY(20px);
}

#m3u-generator-section {
    max-width: 1400px;
    margin: 0 auto;
}

.m3u-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
    margin-top: 2rem;
}

.m3u-config-panel {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.m3u-step {
    margin-bottom: 2.5rem;
}

.m3u-step:last-child {
    margin-bottom: 0;
}

.m3u-step-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.m3u-step-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--gradient);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.m3u-step-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

#m3u-server-select {
    width: 100%;
}

#m3u-libraries-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 1rem;
}

#m3u-libraries-container::-webkit-scrollbar {
    width: 8px;
}

#m3u-libraries-container::-webkit-scrollbar-track {
    background: transparent;
}

#m3u-libraries-container::-webkit-scrollbar-thumb {
    background-color: var(--glass-border);
    border-radius: 8px;
}

#m3u-libraries-container .form-check {
    background: rgba(0, 0, 0, 0.15);
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius-md);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    cursor: pointer;
}

#m3u-libraries-container .form-check:hover {
    background: rgba(0, 0, 0, 0.25);
}

#m3u-libraries-container .form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.8rem;
    background-color: var(--secondary);
    border: 1px solid var(--glass-border);
    flex-shrink: 0; /* Prevent shrinking */
}

#m3u-libraries-container .form-check-label {
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.2; /* Ensure consistent line height */
}

#m3u-libraries-container .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%230a0a0f' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

#m3u-libraries-container .form-check-label {
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#m3u-libraries-container .form-check-label i {
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
    transition: color 0.2s;
}

#m3u-libraries-container .form-check-input:checked + .form-check-label i {
    color: var(--accent);
}

.m3u-info-panel {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.m3u-info-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: white; /* Changed to white for better visibility */
}

.m3u-instructions {
    text-align: left;
    margin-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.m3u-instructions li {
    margin-bottom: 1rem;
}

#download-m3u-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease; /* Added for animation */
}

#download-m3u-btn:hover {
    transform: translateY(-3px); /* Added for hover effect */
    box-shadow: var(--shadow-lg); /* Added for hover effect */
}

#download-m3u-btn span {
    margin-left: 0.5rem;
}

/* Loading state for libraries */
#m3u-libraries-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--text-secondary);
}

#m3u-libraries-loader .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

/* Light Theme */
.light-theme .m3u-config-panel {
    background: var(--secondary);
}

.light-theme #m3u-libraries-container .form-check {
    background: rgba(0, 0, 0, 0.03);
}

.light-theme #m3u-libraries-container .form-check:hover {
    background: rgba(0, 0, 0, 0.06);
}

.light-theme #m3u-libraries-container .form-check-input {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.light-theme #m3u-libraries-container .form-check-input:checked {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.light-theme #m3u-libraries-container .form-check-label i {
    color: var(--text-secondary);
}

.light-theme #m3u-libraries-container .form-check-input:checked + .form-check-label i {
    color: var(--accent-dark);
}

/* Responsive */
@media (max-width: 992px) {
    .m3u-container {
        grid-template-columns: 1fr;
    }
}
