body {
    background-color: #0e0e10;
    color: #eee;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input,
button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    margin: 0;
    border: none;
    cursor: pointer;
}

input {
    width: 200px;
}

#video-container {
    margin-top: 2rem;
    width: 100%;
    max-width: 900px;
    position: relative;
    border: 2px solid #444;
    border-radius: 12px;
    overflow: hidden;
    /* Add aspect ratio */
    aspect-ratio: 16 / 9;
    background-color: #1a1a1c; /* Darker background for the empty player */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Add a placeholder message when no content is loaded */
#video-container::before {
    content: "Enter a Twitch channel to start watching";
    color: #555;
    font-size: 1.2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none; /* Prevent interaction with the placeholder */
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Hide placeholder when video is playing */
#video-container.stream-active::before {
    opacity: 0;
}

#video {
    width: 100%;
    display: block;
    height: 100%; /* Ensure video fills the container */
    object-fit: contain; /* Maintain aspect ratio of the video */
}

.status {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #aaa;
}

.live-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.live-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: red;
    transition: background-color 0.3s ease;
}

.live-dot.inactive {
    background-color: gray;
}

.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    /* Remove flex-direction: column since we no longer have stacked elements */
    padding: 10px 15px; /* Add more horizontal padding for better appearance */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

#video-container:hover .custom-controls {
    opacity: 1;
    pointer-events: auto;
}

.seekbar-container {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    margin-bottom: 10px;
}

.seekbar-progress {
    height: 100%;
    background-color: #47ffa9;
    border-radius: 4px;
    position: relative;
}

.seekbar-handle {
    position: absolute;
    right: -6px;
    top: -4px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.1s ease;
}

.seekbar-container:hover .seekbar-handle {
    transform: scale(1);
}


.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%; /* Ensure it takes full width */
}

.left-controls,
.right-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ...existing CSS... */

.control-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    font-size: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.control-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.control-button i {
    font-size: 16px;
}

/* ...existing CSS... */

.time-display {
    color: white;
    font-size: 14px;
}

.live-indicator {
    color: white;
    background-color: red;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.live-indicator.inactive {
    background-color: #555;
}

/* Auth Loading Screen */
#auth-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(14, 14, 16, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(71, 255, 169, 0.3);
    border-radius: 50%;
    border-top-color: #47ffa9;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-message {
    font-size: 1.6rem;
    color: #eee;
}

.auth-description {
    font-size: 1rem;
    color: #aaa;
    margin-top: 10px;
    text-align: center;
}

.login-link {
    margin-top: 20px;
    display: none;
    color: #47ffa9;
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid #47ffa9;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.login-link:hover {
    background-color: rgba(71, 255, 169, 0.1);
}

/* Hide main content initially */
#main-content {
    display: none;
    text-align: center;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    #video-container {
        max-width: 100%;
        border: none;
        border-radius: 0;
    }

    .custom-controls {
        padding: 8px;
        opacity: 1; /* Always visible on mobile */
        pointer-events: auto;
        transition: none; /* Disable hover-based opacity changes */
    }

    .control-button {
        font-size: 18px;
        width: 40px;
        height: 40px;
    }

    .time-display {
        font-size: 16px;
    }

    .live-indicator {
        font-size: 14px;
        padding: 5px 8px;
    }

    .seekbar-container {
        height: 12px;
    }

    .seekbar-handle {
        width: 20px;
        height: 20px;
    }
}

.stream-directory {
    margin-top: 2rem;
    width: 100%;
    max-width: 900px;
}

.stream-directory h2 {
    margin-bottom: 1rem;
    text-align: center;
    color: #47ffa9;
}

.stream-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stream-card {
    background-color: #1a1a1c;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #333;
}

.stream-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(71, 255, 169, 0.2);
    border-color: #47ffa9;
}

.stream-thumbnail {
    height: 100px;
    background-color: #0e0e10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #47ffa9;
}

.stream-thumbnail i {
    font-size: 2.5rem;
}

.stream-info {
    padding: 0.8rem;
}

.stream-title {
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.stream-channel {
    font-size: 0.8rem;
    color: #aaa;
}

.stream-card.active {
    border-color: #47ffa9;
    box-shadow: 0 0 10px rgba(71, 255, 169, 0.4);
}

/* Mobile responsive adjustments for stream directory */
@media (max-width: 768px) {
    .stream-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stream-grid {
        grid-template-columns: 1fr;
    }
    
    .stream-thumbnail {
        height: 80px;
    }
}

.stream-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(14, 14, 16);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.stream-loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stream-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(71, 255, 169, 0.3);
    border-radius: 50%;
    border-top-color: #47ffa9;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.4rem;
    color: #47ffa9;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(71, 255, 169, 0.5);
}

.loading-explanation {
    font-size: 1rem;
    color: #aaa;
    margin-top: 10px;
    text-align: center;
}

.countdown-timer {
    font-size: 2.5rem;
    font-weight: bold;
    color: #47ffa9;
    margin-top: 15px;
    font-family: monospace;
    min-width: 60px;
    text-align: center;
    text-shadow: 0 0 10px rgba(71, 255, 169, 0.5);
}

/* Mobile responsive adjustments for loading overlay */
@media (max-width: 768px) {
    .stream-spinner {
        width: 50px;
        height: 50px;
    }
    
    .loading-text {
        font-size: 1.2rem;
    }
    
    .loading-explanation {
        font-size: 0.9rem;
    }
    
    .countdown-timer {
        font-size: 2rem;
    }
}

.audio-notification {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    border: 1px solid rgba(71, 255, 169, 0.5);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    max-width: 90%;
}

.audio-notification.visible {
    opacity: 1;
    pointer-events: auto;
}

.audio-notification i {
    color: #47ffa9;
    font-size: 1.1rem;
}

.dismiss-button {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.dismiss-button:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile responsive adjustments for audio notification */
@media (max-width: 768px) {
    .audio-notification {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .logo-image {
    width: 50px;
    height: 50px;
  }
  
  /* Footer styles */
  .site-footer {
    margin-top: 3rem;
    padding: 1.5rem;
    border-top: 1px solid #333;
    width: 100%;
    max-width: 900px;
  }
  
  .footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }
  
  .footer-logo-img {
    width: 30px;
    height: 30px;
    opacity: 0.7;
  }
  
  .footer-info {
    font-size: 0.8rem;
    color: #777;
    text-align: center;
  }
  
  .version {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 0.3rem;
  }
  
  /* Mobile responsive adjustments */
  @media (max-width: 768px) {
    .header {
      flex-direction: column;
      gap: 0.5rem;
    }
    
    .logo-image {
      width: 40px;
      height: 40px;
    }
    
    .site-footer {
      padding: 1rem;
    }
    
    .footer-content {
      flex-direction: column;
      gap: 0.8rem;
    }
  }