body, html {
    height: 100%;
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #18181b;
    color: #efeff1;
    overflow: hidden;
}

#app-container {
    display: flex;
    height: 100vh;
    position: relative; /* For positioning donation alerts */
}

#stream-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}

#url-controls {
    display: flex;
    gap: 0.5rem;
}

#video-url {
    flex-grow: 1;
    padding: 0.5rem;
    border: 1px solid #3e3e40;
    background-color: #2a2a2d;
    color: #efeff1;
    border-radius: 5px;
    font-size: 1rem;
}

#load-video, #share-screen, #upload-video {
    padding: 0.5rem 1rem;
    background-color: #f05a28;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

#load-video:hover, #share-screen:hover, #upload-video:hover {
    background-color: #e04a18;
}

#stream-display {
    flex-grow: 1;
    position: relative;
    background-color: black;
    border-radius: 5px;
    overflow: hidden;
}

#video-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#video-placeholder {
    color: #888;
    font-size: 1.2rem;
    text-align: center;
}

#video-player {
    width: 100%;
    height: 100%;
    border: none;
    display: none;
}

#screen-share-player {
    width: 100%;
    height: 100%;
    display: none;
    object-fit: contain; /* Keeps aspect ratio */
    background-color: black;
}

#firey-reactor {
    position: absolute;
    bottom: -10px;
    left: -20px;
    width: 250px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 165, 0, 0.5));
    pointer-events: none;
    transition: transform 0.2s ease-in-out;
}

#firey-reactor:hover {
    transform: scale(1.05);
}

#speech-bubble {
    position: absolute;
    bottom: 220px;
    left: 120px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #18181b;
    padding: 1rem;
    border-radius: 15px;
    max-width: 250px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    z-index: 10;
    display: none; /* Initially hidden */
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
    animation: fadeInBubble 0.3s ease-out;
    pointer-events: none;
}

#speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 30px;
    border-width: 15px 15px 0 0;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.9) transparent transparent transparent;
    transform: rotate(45deg);
}

#chat-section {
    width: 350px;
    min-width: 300px;
    background-color: #1f1f23;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #3e3e40;
}

#chat-header {
    padding: 1rem;
    border-bottom: 1px solid #3e3e40;
    flex-shrink: 0;
}

#chat-header h3 {
    margin: 0;
    text-align: center;
    font-size: 1.2rem;
}

#chat-messages {
    flex-grow: 1;
    padding: 0.5rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    word-wrap: break-word;
}

.chat-message {
    padding: 0.5rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-in-out;
}

.chat-message .username {
    font-weight: bold;
    margin-right: 0.5em;
}

.donation-message {
    background: linear-gradient(45deg, #f97316, #ea580c);
    border: 1px solid #fdba74;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    color: white;
    animation: fadeInDonation 0.5s ease-out;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

.donation-header {
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.coin-icon {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.5));
}

.donation-body {
    font-style: italic;
    font-size: 1rem;
    padding-left: calc(20px + 0.5rem); /* Align with text in header */
    opacity: 0.9;
}

/* Styles for user chat input */
#chat-input-container {
    padding: 0.75rem;
    border-top: 1px solid #3e3e40;
    background-color: #1f1f23;
}

#chat-form {
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex-grow: 1;
    padding: 0.5rem;
    border: 1px solid #3e3e40;
    background-color: #2a2a2d;
    color: #efeff1;
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #f05a28;
}

#send-chat-btn {
    padding: 0.5rem 1rem;
    background-color: #f05a28;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

#send-chat-btn:hover {
    background-color: #e04a18;
}

/* User's own message style */
.user-message .username {
    color: #f05a28; /* Orange color to stand out */
}

/* Donation Alert Styles */
.donation-alert {
    position: absolute;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: transparent; /* Removed red background per request */
    border: none; /* Removed border for a cleaner, background-less look */
    border-radius: 15px;
    padding: 1rem;
    color: white;
    text-align: center;
    animation: donationAlertAnim 5s ease-in-out forwards;
    pointer-events: none;
    max-width: 250px;
    word-wrap: break-word;
}

.donation-alert img {
    width: 100px;
    height: auto;
    margin-bottom: 0.5rem;
}

.donation-alert p {
    margin: 0;
    font-weight: bold;
    font-style: italic;
    font-size: 1.1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.donation-alert-info {
    margin: 0.25rem 0;
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.donation-alert-info span {
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.donation-alert-message {
    margin: 0.25rem 0 0 0;
    font-style: italic;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    opacity: 0.9;
}

@keyframes donationAlertAnim {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.7);
    }
    10%, 90% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.7);
    }
}

#chat-messages::-webkit-scrollbar {
  width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #1f1f23;
}

#chat-messages::-webkit-scrollbar-thumb {
  background-color: #53535f;
  border-radius: 4px;
}

#donation-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #3e3e40;
}

#donation-amount {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #3e3e40;
    background-color: #2a2a2d;
    color: #efeff1;
    border-radius: 5px;
    font-size: 1rem;
}

#donation-message {
    flex-grow: 1;
    padding: 0.5rem;
    border: 1px solid #3e3e40;
    background-color: #2a2a2d;
    color: #efeff1;
    border-radius: 5px;
    font-size: 1rem;
}

#send-donation-btn {
    padding: 0.5rem 1rem;
    background-color: #f05a28;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

#send-donation-btn:hover {
    background-color: #e04a18;
}