
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

body.dark-mode, .dark-mode body {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}

.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

header {
    background-color: #333;
    color: white;
    padding: 10px;
}

main {
    padding: 20px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.styled-button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    margin: 5px;
    border-radius: 4px;
    cursor: pointer;
}

.styled-button:hover {
    background-color: #45a049;
}

.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
}

.toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

.rss-item {
    background: white;
    margin: 10px 0;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.dark-mode .rss-item {
    background: #333;
    border-color: #555;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
}

header {
    width: 100%;
    padding: 20px;
    background-color: #333; /* Changed to a neutral color */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0 0 0 20px; /* Add left margin */
}

.top-right-buttons {
    display: flex;
    gap: 10px;
    margin-right: 20px; /* Add right margin */
}

main {
    width: 95%; /* Adjusted width to bring it back slightly */
    max-width: 1400px; /* Adjusted max-width for a more balanced layout */
    margin: 0 auto; /* Center the main content */
    padding: 20px;
}

/* Center the filter form */
.filter-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.form-container {
    width: 95%; /* Utilize the full width */
    max-width: 1400px; /* Further adjust max-width for a balanced center area */
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    margin-top: 0;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.inline-form label {
    margin-bottom: 0;
}

.inline-form input, .inline-form select, .inline-form button {
    margin-bottom: 0;
}

.channel-list-container, .category-list-container, .favorites-list-container, .watch-later-list-container {
    width: 95%; /* Utilize the full width */
    max-width: 1400px; /* Further adjust max-width for a balanced center area */
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.channel-list, .category-list, .favorites-list {
    display: flex;
    flex-direction: column; /* Change to column layout */
    gap: 20px;
}

.channel-item, .category-item, .favorite-item {
    flex: 1 1 100%; /* Ensure each item takes full width */
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.channel-header, .category-header, .favorite-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start; /* Align items to the left */
    gap: 20px; /* Add gap between elements */
}

.channel-actions, .category-actions, .favorite-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.channel-header h3, .category-header h3, .favorite-header h3 {
    margin: 0;
    flex-shrink: 0; /* Prevents the name from shrinking */
}

.channel-actions p, .category-actions p, .favorite-actions p {
    margin: 0 10px 0 0; /* Adjust the margin as needed */
    white-space: nowrap; /* Prevents text wrapping */
}

.channel-item form.inline-form, .category-item form.inline-form, .favorite-item form.inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap; /* Prevents form elements from wrapping */
}

.channel-item form.inline-form select, .channel-item form.inline-form button,
.category-item form.inline-form select, .category-item form.inline-form button,
.favorite-item form.inline-form select, .favorite-item form.inline-form button {
    flex-shrink: 0; /* Prevents elements from shrinking */
}

button {
    padding: 10px 20px;
    background-color: #4a90e2; /* Changed from red to a soft blue */
    color: white;
    border: none;
    border-radius: 20px; /* Slightly rounded corners */
    cursor: pointer;
    font-size: 12px; /* Adjust font size */
    font-weight: bold; /* Bold text */
    text-transform: uppercase; /* Uppercase text */
    transition: background-color 0.3s ease; /* Smooth transition */
}

button:hover {
    background-color: #357abd; /* Darker version of the soft blue */
}

.dark-mode {
    background-color: #121212; /* Darker background for dark mode */
    color: #e0e0e0; /* Lighter text color for better contrast */
}

.dark-mode .form-container, .dark-mode .channel-list-container, .dark-mode .category-list-container, .dark-mode .favorites-list-container, .watch-later-list-container {
    background-color: #1e1e1e; /* Darker background for containers */
    color: #e0e0e0; /* Lighter text color for better contrast */
}

.dark-mode .channel-item, .dark-mode .category-item, .dark-mode .favorite-item {
    background-color: #2a2a2a; /* Darker background for items */
}

.dark-mode button {
    background-color: #444;
    color: #e0e0e0;
}

.dark-mode button:hover {
    background-color: #222;
}

/* Center the video player */
.video-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.video-container #videoPlayer {
    width: 100%;
    max-width: 800px; /* Adjust the max-width as needed */
    height: 450px; /* Adjust the height as needed */
    border: 1px solid #ccc;
}

/* Center the buttons under the video player */
.button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.styled-button {
    padding: 10px 20px;
    background-color: #4a90e2; /* Changed from red to soft blue */
    color: white;
    border: none;
    border-radius: 20px; /* Slightly rounded corners */
    cursor: pointer;
    font-size: 12px; /* Adjust font size */
    font-weight: bold; /* Bold text */
    text-transform: uppercase; /* Uppercase text */
    transition: background-color 0.3s ease; /* Smooth transition */
}

.styled-button:hover {
    background-color: #357abd; /* Darker version of the soft blue */
}

.section {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.dark-mode .section {
    background-color: #2a2a2a;
    border-color: #555;
}

.video-container img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    margin-bottom: 5px;
}

/* Error message styling */
.error-message {
    color: red;
    font-weight: bold;
}

.toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 2px;
    padding: 16px;
    position: fixed;
    z-index: 1;
    left: 50%;
    bottom: 30px;
    font-size: 17px;
}

.toast.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@-webkit-keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

/* Accordion styles */
.accordion-section {
    margin-bottom: 20px;
}

.accordion-header {
    cursor: pointer;
    padding: 10px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    position: relative; /* Needed for the arrow positioning */
}

.accordion-header::after {
    content: '\25BC'; /* Downward arrow */
    position: absolute;
    right: 10px;
    transition: transform 0.3s ease;
}

.accordion-section.active .accordion-header::after {
    transform: rotate(180deg); /* Rotate the arrow when active */
}

.accordion-content {
    display: none;
    padding: 10px;
    border: 1px solid #ccc;
    border-top: none;
}

.accordion-section.active .accordion-content {
    display: block;
}

.dark-mode .accordion-header {
    background-color: #333;
    border-color: #555;
}

.dark-mode .accordion-content {
    background-color: #1e1e1e;
    border-color: #555;
}

.dark-mode .accordion-header::after {
    color: #e0e0e0; /* Lighter color for the arrow in dark mode */
}

.category-item {
    flex: 1 1 100%; /* Ensure each item takes full width */
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.category-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start; /* Align items to the left */
    gap: 20px; /* Add gap between elements */
}

.category-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.category-header h3 {
    margin: 0;
    flex-shrink: 0; /* Prevents the name from shrinking */
}

.category-actions p {
    margin: 0 10px 0 0; /* Adjust the margin as needed */
    white-space: nowrap; /* Prevents text wrapping */
}

.category-item form.inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap; /* Prevents form elements from wrapping */
}

.category-item form.inline-form select, .category-item form.inline-form button {
    flex-shrink: 0; /* Prevents elements from shrinking */
}

.dark-mode .category-item {
    background-color: #2a2a2a; /* Darker background for category items */
}

.favorite-item {
    flex: 1 1 100%; /* Ensure each item takes full width */
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.favorite-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start; /* Align items to the left */
    gap: 20px; /* Add gap between elements */
}

.favorite-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.favorite-header h3 {
    margin: 0;
    flex-shrink: 0; /* Prevents the name from shrinking */
}

.favorite-actions p {
    margin: 0 10px 0 0; /* Adjust the margin as needed */
    white-space: nowrap; /* Prevents text wrapping */
}

.favorite-item form.inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap; /* Prevents form elements from wrapping */
}

.favorite-item form.inline-form select, .favorite-item form.inline-form button {
    flex-shrink: 0; /* Prevents elements from shrinking */
}

.dark-mode .favorite-item {
    background-color: #2a2a2a; /* Darker background for favorite items */
}

/* Existing styles */

.thumbnail-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around; /* Distribute items evenly */
    list-style: none;
    padding: 0;
}

.thumbnail-item {
    width: 30%; /* Adjust as needed for spacing */
    margin-bottom: 20px;
    text-align: center;
}

.thumbnail-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.thumbnail-item img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 5px; /* Add buffer between thumbnail and title */
}

.thumbnail-item span {
    display: block;
    margin-top: 5px;
}

/* Override styles for favorites list container */
.favorites-list-container, .watch-later-list-container {
    border: none !important;
    box-shadow: none !important;
}