/* Component styles - Reusable UI components */

/* =================================================================
   VIDEO HEADER - Top section of video area
   ================================================================= */

.video-header {
    background: linear-gradient(135deg, var(--dodgers-blue-700) 0%, var(--dodgers-blue-500) 100%);
    padding: var(--spacing-3) var(--spacing-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-dodgers-md);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-5);
}

.logo {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.logo::before {
    content: "⚾";
    font-size: var(--font-size-2xl);
}

/* =================================================================
   STREAM STATS - Viewer count and badges
   ================================================================= */

.stream-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
}

.viewer-count {
    background: rgba(255,255,255,0.2);
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--border-radius-2xl);
    color: white;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    backdrop-filter: blur(10px);
}

.viewer-count::before {
    content: "👥";
}

.stream-badge {
    background: var(--dodgers-red);
    color: white;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--border-radius-2xl);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

/* =================================================================
   HEADER CONTROLS - Buttons and selectors
   ================================================================= */

.header-controls {
    display: flex;
    gap: var(--spacing-3);
    align-items: center;
}

/* Ensure all header control buttons have identical dimensions */
.header-controls > * {
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    vertical-align: top;
    line-height: 1;
}

.quality-selector {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--border-radius-2xl);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    backdrop-filter: blur(10px);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-height: auto;
}

.toggle-chat-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--border-radius-2xl);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    position: relative;
}

.toggle-chat-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.manual-refresh-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--border-radius-2xl);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    position: relative;
}

.manual-refresh-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* =================================================================
   CHAT HEADER
   ================================================================= */

.chat-header {
    background: linear-gradient(135deg, var(--dodgers-blue-500) 0%, var(--dodgers-blue-300) 100%);
    padding: var(--spacing-4) var(--spacing-5);
    color: white;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.chat-header-left::before {
    content: "💬";
    font-size: var(--font-size-lg);
}

.admin-controls {
    display: flex;
    gap: var(--spacing-2);
}

.admin-btn {
    background: rgba(255,215,0,0.3);
    border: 1px solid var(--dodgers-gold);
    color: white;
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: var(--border-radius-xl);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.admin-btn:hover {
    background: rgba(255,215,0,0.5);
}

/* =================================================================
   USER INFO SECTION
   ================================================================= */

.user-info {
    padding: var(--spacing-3) var(--spacing-4);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.user-id-display {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--spacing-2);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.id-badge {
    background: var(--dodgers-blue-500);
    color: white;
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--border-radius-xl);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-mono);
}

.id-badge.admin {
    background: linear-gradient(135deg, var(--dodgers-gold), #FFB700);
    color: #333;
}

.nickname-input {
    position: relative;
}

.nickname-input input {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-3);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
    background: var(--input-bg);
    color: var(--text-primary);
}

.nickname-input input::placeholder {
    color: var(--text-muted);
}

.nickname-input input:focus {
    outline: none;
    border-color: var(--dodgers-blue-500);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* =================================================================
   CHAT MESSAGES CONTAINER
   ================================================================= */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-4);
    background: var(--bg-dark);
}

/* =================================================================
   MESSAGE COMPONENTS
   ================================================================= */

.message {
    margin-bottom: var(--spacing-4);
    animation: slideIn var(--transition-slow);
    position: relative;
}

.message:hover .message-actions {
    opacity: 1;
}

.message-actions {
    position: absolute;
    right: 0;
    top: 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
    display: flex;
    gap: var(--spacing-1);
}

.delete-btn, .ban-btn {
    background: rgba(239,62,66,0.9);
    color: white;
    border: none;
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xs);
    cursor: pointer;
}

.ban-btn {
    background: rgba(255,152,0,0.9);
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-1);
    flex-wrap: wrap;
}

.message-nickname {
    font-weight: var(--font-weight-semibold);
    color: var(--dodgers-blue-500);
    font-size: var(--font-size-sm);
}

.message-nickname.admin {
    color: var(--dodgers-gold);
    text-shadow: 0 0 2px rgba(255,215,0,0.5);
}

.message-id {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-family: var(--font-family-mono);
    background: var(--border-color);
    padding: 1px var(--spacing-1);
    border-radius: var(--border-radius-xl);
}

.message-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-left: auto;
}

.message-text {
    padding: var(--spacing-2) var(--spacing-3);
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    box-shadow: var(--shadow-sm);
    border-left: 3px solid transparent;
    color: var(--text-primary);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

.own-message .message-nickname {
    color: var(--dodgers-red-500);
}

.own-message .message-text {
    background: rgba(0,90,156,0.2);
    border-left-color: var(--dodgers-blue-500);
}

.admin-message .message-text {
    background: var(--admin-bg);
    border-left-color: var(--dodgers-gold);
}

.system-message {
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-style: italic;
    margin: var(--spacing-3) 0;
    padding: var(--spacing-2);
    background: rgba(0,90,156,0.1);
    border-radius: var(--border-radius-md);
}

.typing-indicator {
    padding: 0 var(--spacing-4) var(--spacing-2);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-style: italic;
    display: none;
}

.typing-indicator.active {
    display: block;
}

.typing-indicator span {
    animation: blink 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* =================================================================
   CHAT INPUT AREA
   ================================================================= */

.chat-input {
    padding: var(--spacing-3) var(--spacing-4);
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.input-group {
    display: flex;
    gap: var(--spacing-2);
}

.chat-input input {
    flex: 1;
    padding: var(--spacing-3) var(--spacing-4);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-2xl);
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
    background: var(--input-bg);
    color: var(--text-primary);
}

.chat-input input::placeholder {
    color: var(--text-muted);
}

.chat-input input:focus {
    outline: none;
    border-color: var(--dodgers-blue-500);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.chat-input button {
    padding: var(--spacing-3) var(--spacing-5);
    background: linear-gradient(135deg, var(--dodgers-blue-500), var(--dodgers-blue-300));
    color: white;
    border: none;
    border-radius: var(--border-radius-2xl);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-dodgers-sm);
}

.chat-input button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-dodgers-md);
}

.chat-input button:active {
    transform: translateY(0);
}

.empty-chat {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-12) var(--spacing-5);
    font-size: var(--font-size-sm);
}

/* =================================================================
   CONNECTION STATUS
   ================================================================= */

.connection-status {
    padding: var(--spacing-2);
    background: var(--bg-darker);
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    border-top: 1px solid var(--border-color);
}

.status-dot {
    width: var(--spacing-2);
    height: var(--spacing-2);
    border-radius: 50%;
    background: #4caf50;
    animation: blink 2s infinite;
}

.status-dot.offline {
    background: #f44336;
    animation: none;
}

/* =================================================================
   NOTIFICATIONS & TOASTS
   ================================================================= */

.toast {
    position: fixed;
    bottom: var(--spacing-5);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: var(--spacing-3) var(--spacing-5);
    border-radius: var(--border-radius-2xl);
    font-size: var(--font-size-sm);
    z-index: var(--z-toast);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.toast.show {
    opacity: 1;
}

.notification-badge {
    position: absolute;
    top: calc(var(--spacing-2) * -1);
    right: calc(var(--spacing-2) * -1);
    background: var(--dodgers-red);
    color: white;
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-1) var(--spacing-2);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    display: none;
    animation: bounce 0.5s;
}

.notification-badge.show {
    display: block;
}

/* =================================================================
   FLOATING ACTION BUTTONS
   ================================================================= */

.fab-container {
    position: fixed;
    bottom: var(--spacing-5);
    right: var(--spacing-5);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    z-index: var(--z-fixed);
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dodgers-blue-500), var(--dodgers-blue-300));
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-dodgers-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all var(--transition-base);
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-dodgers-lg);
}

.fab.secondary {
    width: 48px;
    height: 48px;
    font-size: 20px;
    background: rgba(0,90,156,0.9);
}
