/*
Theme Name: USNOW Live
Author: Your Name
Description: A custom theme for the USNOW live streaming application.
Version: 1.0
*/

html, body {
  margin: 0;
  padding: 0;
  background: #181818;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* --- Sidebar Styles --- */
.sidebar {
    width: 80px;
    background: #000;
    display: flex;
    flex-direction: column;
    padding: 15px 0;
    box-sizing: border-box;
    transition: width 0.3s ease;
    flex-shrink: 0;
    overflow: hidden;
    z-index: 3000;
}
.sidebar:hover {
    width: 240px;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 25px;
    min-width: 200px; /* Prevent wrapping */
    cursor: pointer;
}
.sidebar-pfp {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #555;
}
.sidebar-pfp img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-username {
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sidebar:hover .sidebar-username {
    opacity: 1;
    transition-delay: 0.1s;
}

.sidebar hr {
    border: none;
    border-top: 1px solid #333;
    margin: 15px 20px;
}

.sidebar-stats {
    display: none;
    justify-content: space-around;
    padding: 0 20px;
    min-width: 200px;
}
.sidebar.logged-in:hover .sidebar-stats {
    display: flex;
}

.stat-item {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sidebar:hover .stat-item {
    opacity: 1;
    transition-delay: 0.1s;
}
.stat-item span {
    font-weight: bold;
    color: #fff;
    display: block;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    flex-grow: 1; /* Pushes logout to bottom */
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #aaa;
    text-decoration: none;
    padding: 15px 25px;
    font-weight: bold;
    white-space: nowrap;
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
    background: #1f1f1f;
    color: #fff;
}
.nav-icon {
    font-size: 24px;
    width: 30px;
    text-align: center;
}
.nav-text {
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sidebar:hover .nav-text {
    opacity: 1;
    transition-delay: 0.1s;
}

/* --- Main Content Area --- */
.main-content {
    flex-grow: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hidden { display: none !important; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: #1f1f1f;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#home-page {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    flex-grow: 1;
}
.home-logo {
    font-size: 120px;
    font-weight: bold;
    color: limegreen;
}

.page-logo { color: limegreen; font-size: 28px; font-weight: bold; cursor: pointer; }

.header-search-bar {
    width: 40%;
    background: #2a2a2a;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 8px 15px 8px 40px;
    color: #fff;
    outline: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23777" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: 15px center;
    transition: all 0.3s ease;
}
.header-search-bar:focus {
    background-color: #333;
    border-color: #555;
}

.profile-section { display: flex; align-items: center; gap: 15px; }
#profile-picture-container { width: 40px; height: 40px; border-radius: 50%; background: #555; cursor: pointer; overflow: hidden; border: 2px solid #777; }
#profile-picture { width: 100%; height: 100%; object-fit: cover; }
#login-btn-header {
    background: limegreen;
    color: #000;
    font-weight: bold;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
}
#logout-btn-header {
    background: #ff5f57;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    cursor: pointer;
    font-weight: bold;
}

.container { display: flex; width: 100%; padding: 20px; box-sizing: border-box; flex-grow: 1; }
.left-panel { flex: 3; display: flex; flex-direction: column; padding-right: 20px; box-sizing: border-box; position: relative; }

.stream-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    min-height: 0;
}
.stream-box {
    width: 100%;
    display: flex; background: #111; border: 2px solid #444;
}
.host, .cohost {
    flex: 1; background: #000; color: #555;
    display: flex; align-items: center; justify-content: center;
}
#live-video-player {
    width: 100%;
    height: 100%;
    background-color: #000;
}
.cohost.hidden { display: none; }

.reaction-bar { height: 50px; margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.vote-control { display: flex; align-items: center; gap: 8px; }
.vote-counter { font-size: 20px; font-weight: bold; min-width: 20px; text-align: center; }
.meter { flex: 1; height: 20px; background: linear-gradient(to right, red 50%, limegreen 50%); border-radius: 10px; position: relative; overflow: hidden; }
.indicator { position: absolute; height: 100%; width: 2px; background: white; left: 50%; transition: left 0.3s ease-in-out; }
.thumb-btn { font-size: 24px; cursor: pointer; }

.right-panel {
    flex: 1; background: #1a1a1a; border-left: 2px solid #444; padding: 10px;
    box-sizing: border-box; position: relative; display: flex; flex-direction: column;
}
.chat-header { display: flex; gap: 10px; margin-bottom: 10px; }
.chat-header span { font-size: 20px; cursor: pointer; }
.animation { position: fixed; z-index: 1000; pointer-events: none; }

#chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 50px; }
.chat-message { background: #333; padding: 8px 12px; border-radius: 8px; max-width: 90%; word-wrap: break-word; }
.chat-message strong { color: limegreen; }
#chat-input-container { position: absolute; bottom: 10px; left: 10px; right: 10px; display: flex; gap: 5px; }
#chat-input { flex: 1; background: #333; border: 1px solid #555; color: #fff; padding: 10px; border-radius: 5px; outline: none; }
#chat-input:focus { border-color: limegreen; }
#send-button { background: limegreen; border: none; color: #000; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-weight: bold; }

#browse-page { padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;}
#join-stream-btn {
    background: limegreen;
    color: #000;
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 20px;
}

.streamer-header { display: flex; justify-content: space-between; align-items: center; padding: 0 0 15px 0; }
.streamer-header-left { display: flex; align-items: center; gap: 15px; }
.streamer-profile-text { font-size: 13px; color: #aaa; }
.streamer-profile-text p { margin: 2px 0; }
.streamer-header-right { display: flex; align-items: center; gap: 15px; }
.header-pfp-container { text-align: center; }
.header-pfp { width: 50px; height: 50px; border-radius: 50%; background: #555; border: 2px solid #777; overflow: hidden; }
.header-pfp img { width: 100%; height: 100%; object-fit: cover; }
#fan-count { font-size: 14px; color: #aaa; font-weight: bold; }
.header-buttons .btn { border: none; padding: 8px 15px; border-radius: 20px; font-weight: bold; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
#fan-button { background-color: #28c940; color: #fff; }
#fan-button.fanned { background-color: #28c940; color: #fff; width: 40px; }
#subscribe-button { background-color: #555; color: #fff; }
#subscribe-button.subscribed { background-color: limegreen; color: #fff; }
#streamer-socials { display: flex; gap: 10px; align-items: center; }
#streamer-socials a img { width: 24px; height: 24px; vertical-align: middle; }

#login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 2000; }
#login-widget, #signup-widget {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 320px; background: #2a2a2a; border-radius: 10px; z-index: 2001;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box; gap: 15px;
}
#login-widget h2, #signup-widget h2 { margin: 0; }
#login-widget input, #signup-widget input { width: 100%; padding: 10px; box-sizing: border-box; border-radius: 5px; border: 1px solid #555; background: #333; color: #fff; font-size: 16px; }
#login-widget button, #signup-widget button { width: 100%; padding: 12px; border-radius: 5px; border: none; background: limegreen; color: #000; font-size: 16px; font-weight: bold; cursor: pointer; }
.form-link { color: limegreen; cursor: pointer; font-size: 14px; margin-top: 10px; }
.form-error { color: #ff5f57; font-size: 12px; min-height: 30px; text-align: center; line-height: 1.4;}

#profile-page { padding: 30px; }

.btn {
    background: #333;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 16px;
    margin: 6px 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn.fanned,
.btn.subscribed {
    background: limegreen;
    color: #000;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}
.stat-item span {
    font-weight: bold;
    color: limegreen;
    font-size: 20px;
}

