body {
    /* Optional: Add some margin reset for full control */
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, Arial, sans-serif;
    background-color: #404231;
    padding: 10px;
}

h1 {
   color: #dcdcdc;
}

.button-container {
    /* Method 1: Using Flexbox for centering (highly recommended) */
    display: flex;
    justify-content: center; /* Centers horizontally */
    align-items: center;     /* Centers vertically */
    /* Adjust height as needed, e.g., if you want it centered in the viewport */
    height: 50px; 
    width: 100%;
}

.back-button {
    /* Button Styling */
    padding: 12px 24px;
    color: #ffffff;
    background-color: #007bff; /* Primary blue color */
    border: none;
    border-radius: 20px; /* Pill shape for a modern look */
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3); /* Subtle shadow */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease; /* Smooth hover effects */
}

.back-button:hover {
    background-color: #0056b3; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.4); /* Enhanced shadow on hover */
}

.back-button:active {
    transform: translateY(0); /* Press down effect */
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

        /* Grid container for the previews */
        .preview-grid {
            display: grid;
            /* Creates a responsive grid: min 300px width per column, up to 4 columns */
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 15px;
            padding: 20px;
        }
        .stream-container {
            position: relative;
            /* Ensures aspect ratio (16:9) */
            padding-bottom: 56.25%; /* 9 / 16 * 100% */
            height: 0;
            overflow: hidden;
            background-color: #333;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            cursor: pointer; /* Indicates it's clickable */
            transition: transform 0.2s;
        }
        .stream-container:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
        }
        .stream-iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: none;
            /* This is the key to pass the URL to the embedded player */
        }
        .stream-title {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            padding: 5px;
            text-align: center;
            font-size: 0.9em;
            z-index: 10;
        }

        /* Fullscreen view styling */
        .fullscreen-overlay {
            display: none; /* Hidden by default */
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.95);
            z-index: 9999; /* High Z-index to cover everything */
        }
        .fullscreen-iframe {
            width: 100%;
            height: 100%;
            border: none;
        }
        .close-button {
            position: absolute;
            top: 20px;
            right: 20px;
            background: red;
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 5px;
            cursor: pointer;
            z-index: 10000;
            font-size: 1.2em;
        }

        @media (max-width: 600px) {
            .preview-grid {
                grid-template-columns: 1fr; /* Single column on small screens */
            }
        }