

/* viewer.css - Foundational Styles for DropIn Live Viewer Page */

/* --- Variables (Customize these later!) --- */
:root {
    --background-color: #f4f4f7; /* Light background */
    --card-background: #ffffff; /* White for content blocks */
    --text-color: #333333;      /* Dark grey text */
    --primary-color: #4a90e2;   /* A sample primary blue */
    --secondary-color: #50e3c2; /* A sample secondary teal/green */
    --live-red: #ff3b30;        /* Red for LIVE badge */
    --border-color: #e0e0e0;    /* Light border */
    --font-family: 'Inter', sans-serif; /* Example modern font stack */
    --header-height: 60px; /* Example height */
}

/* --- Basic Reset & Body --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex; /* Ensures layout takes full height if needed */
    min-height: 100vh;
}

/* --- Main Layout --- */
.live-viewer-layout {
    display: flex;
    width: 100%;
    /* Desktop: Two columns by default */
    flex-direction: row;
}

.main-content {
    flex: 3; /* Takes up ~75% width */
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.chat-sidebar {
    flex: 1; /* Takes up ~25% width */
    background-color: var(--card-background);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full viewport height */
    position: sticky; /* Keeps chat visible on scroll within layout */
    top: 0;
}

/* --- Stream Header Info --- */
.stream-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.title-host h1 {
    font-size: 1.4em;
    margin-bottom: 2px;
    color: var(--text-color);
}

.title-host span {
    font-size: 0.9em;
    color: #666;
}

.status-indicators {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between badges */
}

.live-badge {
    color: var(--live-red);
    font-weight: bold;
    font-size: 0.9em;
}

.viewer-count {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
}

/* --- Video Player --- */
.video-player-container {
    width: 100%;
    background-color: #000; /* Black background for video */
    margin-bottom: 15px;
    position: relative;
    aspect-ratio: 16 / 9; /* Common video aspect ratio */
    border-radius: 8px;
    overflow: hidden; /* Ensures video stays within bounds */
}

#live-video {
    display: block; /* Remove extra space below video */
    width: 100%;
    height: 100%;
    object-fit: contain; /* Fits video within container, preserves aspect ratio */
}

/* --- Interaction Bar --- */
.interaction-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.reactions {
    display: flex;
    gap: 10px;
}

.reaction-button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 1.2em; /* Make emojis slightly bigger */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.reaction-button:hover {
    background-color: #f0f0f0;
}
.reaction-button:active {
    transform: scale(0.95);
}

.support-button {
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.support-button:hover {
    background-color: darken(var(--secondary-color), 10%); /* Function needs SASS/JS or manual darker color */
    background-color: #40c4a5; /* Manual darker shade example */
}


/* --- Chat Sidebar --- */
.chat-feed-container {
    flex-grow: 1; /* Takes up available space */
    overflow-y: auto; /* Enables scrolling for chat messages */
    padding: 15px;
}

#chat-feed-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: #f9f9f9; /* Slightly off-white for messages */
    word-wrap: break-word; /* Prevents long words from overflowing */
}

.chat-message.system {
    font-style: italic;
    color: #777;
    background-color: transparent;
    text-align: center;
    font-size: 0.9em;
}

.chat-message strong { /* Username */
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 5px;
}

/* Optional: Style user's own messages differently */
/* .chat-message.own-message { background-color: #e1f5fe; } */


.chat-input-container {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background-color: #fff; /* Ensure it's on white bg */
    display: flex;
    gap: 10px;
}

#chat-message-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 1em;
}

#send-chat-button {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

#send-chat-button:hover {
    background-color: darken(var(--primary-color), 10%); /* Needs SASS/JS or manual darker color */
    background-color: #3a7bc8; /* Manual darker shade example */
}


/* --- Responsiveness (Mobile First Approach Example) --- */

/* Styles for smaller screens (default - mobile first) */
.live-viewer-layout {
    flex-direction: column;
    height: auto; /* Allow content to determine height */
}

.chat-sidebar {
    flex: none; /* Don't flex grow */
    width: 100%;
    height: auto; /* Chat height determined by content + input */
    max-height: 50vh; /* Limit chat height on mobile, or adjust as needed */
    border-left: none;
    border-top: 1px solid var(--border-color);
    position: relative; /* Not sticky in column layout */
}

.main-content {
     flex: none; /* Don't flex grow */
     width: 100%;
     order: 1; /* Show video content first */
     padding: 10px; /* Reduce padding on mobile */
}

.chat-sidebar {
    order: 2; /* Show chat below content */
}

/* Larger screens (e.g., tablets and desktops) */
@media (min-width: 992px) { /* Adjust breakpoint as needed */
    .live-viewer-layout {
        flex-direction: row; /* Switch back to row layout */
        height: 100vh; /* Use full viewport height */
    }

    .main-content {
        flex: 3;
        padding: 20px;
        order: 0; /* Reset order */
        overflow-y: auto; /* Allow main content area to scroll if needed */
    }

    .chat-sidebar {
        flex: 1;
        height: 100vh; /* Full height */
        max-height: none; /* Remove mobile height limit */
        border-left: 1px solid var(--border-color);
        border-top: none;
        position: sticky; /* Make sticky again */
        top: 0;
        order: 0; /* Reset order */
    }

    .chat-input-container {
        /* Optionally make input stick to bottom of chat sidebar on desktop */
        /* position: sticky;
        bottom: 0; */
    }
}