/* ==========================================================================
   StreamOBS Live - Frontend Styles
   ========================================================================== */

:root {
    --streamobs-primary: #6366f1;
    --streamobs-secondary: #8b5cf6;
    --streamobs-dark: #1e1b4b;
    --streamobs-darker: #0f172a;
    --streamobs-light: #f8fafc;
    --streamobs-border: #e2e8f0;
    --streamobs-success: #10b981;
    --streamobs-danger: #ef4444;
    --streamobs-warning: #f59e0b;
    --streamobs-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --streamobs-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Container */
.streamobs-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.streamobs-player-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    background: var(--streamobs-darker);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--streamobs-shadow-lg);
}

/* Video Player */
.streamobs-video-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.streamobs-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Live Badge */
.streamobs-live-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--streamobs-danger) 0%, #dc2626 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    animation: pulse 2s infinite;
}

.streamobs-live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.streamobs-viewer-count {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* Offline Message */
.streamobs-offline-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    text-align: center;
    padding: 40px;
}

.streamobs-offline-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.streamobs-offline-message h3 {
    color: white;
    font-size: 24px;
    margin: 0 0 10px 0;
}

/* Reactions Overlay */
.streamobs-reactions-overlay {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    height: 300px;
    pointer-events: none;
    overflow: hidden;
}

.streamobs-reaction-float {
    position: absolute;
    font-size: 32px;
    animation: float-up 3s ease-out forwards;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-300px) scale(1.2);
        opacity: 0;
    }
}

/* Stream Info */
.streamobs-stream-info {
    background: var(--streamobs-dark);
    padding: 20px;
    border-radius: 12px;
    margin-top: 15px;
}

.streamobs-stream-title {
    color: white;
    font-size: 20px;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.streamobs-stream-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #94a3b8;
    font-size: 14px;
}

.streamobs-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.streamobs-author img {
    border-radius: 50%;
}

.streamobs-author strong {
    color: white;
}

.streamobs-views {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Reactions Bar */
.streamobs-reactions-bar {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: var(--streamobs-dark);
    border-radius: 12px;
    margin-top: 15px;
    overflow-x: auto;
}

.streamobs-reaction-btn {
    flex: 1;
    min-width: 60px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.streamobs-reaction-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--streamobs-primary);
    transform: translateY(-2px);
}

.streamobs-reaction-btn:active {
    transform: scale(0.95);
}

.streamobs-reaction-emoji {
    font-size: 24px;
    display: block;
}

.streamobs-reaction-count {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}

/* Chat Sidebar */
.streamobs-chat-sidebar {
    background: var(--streamobs-dark);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.streamobs-chat-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.streamobs-chat-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
}

.streamobs-online-count {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 14px;
}

.streamobs-online-dot {
    width: 8px;
    height: 8px;
    background: var(--streamobs-success);
    border-radius: 50%;
    animation: blink 2s infinite;
}

/* Chat Messages */
.streamobs-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.streamobs-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.streamobs-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.streamobs-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.streamobs-chat-welcome {
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
    font-size: 14px;
}

.streamobs-chat-message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.streamobs-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.streamobs-chat-content {
    flex: 1;
    min-width: 0;
}

.streamobs-chat-author {
    color: var(--streamobs-primary);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.streamobs-chat-text {
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.streamobs-chat-time {
    color: #64748b;
    font-size: 11px;
    margin-top: 4px;
}

/* Chat Input */
.streamobs-chat-input-container {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    align-items: center;
}

.streamobs-chat-user-info {
    flex-shrink: 0;
}

.streamobs-chat-user-info img {
    border-radius: 50%;
    display: block;
}

.streamobs-chat-input-wrapper {
    flex: 1;
    position: relative;
}

.streamobs-chat-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    color: white;
    padding: 12px 40px 12px 12px;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.streamobs-chat-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--streamobs-primary);
}

.streamobs-emoji-picker-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.streamobs-emoji-picker-btn:hover {
    opacity: 1;
}

.streamobs-send-btn {
    background: linear-gradient(135deg, var(--streamobs-primary) 0%, var(--streamobs-secondary) 100%);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.streamobs-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.4);
}

.streamobs-send-btn:active {
    transform: translateY(0);
}

.streamobs-chat-login-message {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.streamobs-chat-login-message a {
    color: var(--streamobs-primary);
    text-decoration: none;
}

.streamobs-chat-login-message a:hover {
    text-decoration: underline;
}

/* Connection Status */
.streamobs-connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--streamobs-dark);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: var(--streamobs-shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.streamobs-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--streamobs-warning);
    animation: blink 1s infinite;
}

.streamobs-connection-status.connected .streamobs-status-dot {
    background: var(--streamobs-success);
    animation: none;
}

.streamobs-connection-status.disconnected .streamobs-status-dot {
    background: var(--streamobs-danger);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .streamobs-player-wrapper {
        grid-template-columns: 1fr;
    }
    
    .streamobs-chat-sidebar {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .streamobs-container {
        padding: 10px;
    }
    
    .streamobs-player-wrapper {
        gap: 15px;
    }
    
    .streamobs-reactions-bar {
        gap: 6px;
        padding: 12px 15px;
    }
    
    .streamobs-reaction-btn {
        min-width: 50px;
        padding: 8px;
    }
    
    .streamobs-reaction-emoji {
        font-size: 20px;
    }
}
