/**
 * Talk Live Chat Styles
 *
 * @package SMX_Pages
 */

.smx-talk-chat-container {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    overflow: hidden;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: inherit;
}

/* Header */
.smx-talk-chat-header {
    background: #252525;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.smx-talk-chat-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.smx-chat-presenter-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #ddd;
}

.smx-chat-presenter-label {
    opacity: 0.8;
}

.smx-chat-presenter-name {
    font-weight: 600;
}

/* Participation Instructions */
.smx-chat-participation {
    display: none; /* Initially hidden until chat status is known */
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    padding: 14px 20px;
    font-size: 13px;
}

.smx-chat-participation-title {
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f1f1f1;
}

.smx-chat-participation-body {
    color: #ccc;
}

.smx-chat-participation-body p {
    margin: 0 0 4px;
}

.smx-chat-participation-body p:last-child {
    margin-bottom: 0;
}

.smx-chat-participation.is-live {
    display: block;
}

.smx-chat-participation.is-closed {
    display: none;
}

.smx-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #555;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.smx-talk-chat-status.live .smx-status-indicator {
    background: #ff4757;
    box-shadow: 0 0 10px #ff4757;
    animation: smx-pulse 1.5s infinite;
}

.smx-talk-chat-status.live .smx-status-text {
    color: #ff4757;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes smx-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Presenter Controls - Removed from frontend */
.smx-talk-presenter-controls {
    display: none; /* Hidden on frontend - only in admin */
}

/* Messages Area */
.smx-talk-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #121212;
}

.smx-chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    gap: 10px;
}

.smx-message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: smx-slide-in 0.3s ease-out;
}

@keyframes smx-slide-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.smx-message-meta {
    font-size: 11px;
    margin-bottom: 4px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}

.smx-message-author {
    font-weight: 700;
    color: #aaa;
}

.smx-message-bubble {
    background: #2a2a2a;
    padding: 10px 14px;
    border-radius: 18px 18px 18px 4px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Presenter Style Messages */
.smx-message.is-presenter {
    align-self: flex-start;
}

.smx-message.is-presenter .smx-message-bubble {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    border: none;
}

.smx-presenter-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 800;
}

/* Universal Message Styles */
.smx-message.is-universal {
    align-self: center;
    max-width: 90%;
    margin: 15px auto;
}

.smx-message.is-universal .smx-message-bubble {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.smx-universal-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Footer & Form */
.smx-talk-chat-footer {
    background: #252525;
    padding: 20px;
    border-top: 1px solid #333;
}

.smx-talk-chat-form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.smx-talk-chat-nickname-field input {
    width: 100%;
    background: #121212;
    border: 1px solid #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.smx-talk-chat-nickname-field input:focus {
    border-color: #6c5ce7;
}

.smx-talk-chat-input-field {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.smx-talk-chat-input-field textarea {
    flex: 1;
    background: #121212;
    border: 1px solid #333;
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    resize: none;
    height: 44px;
    outline: none;
    transition: border-color 0.2s;
}

.smx-talk-chat-input-field textarea:focus:not(:disabled) {
    border-color: #6c5ce7;
}

.smx-talk-chat-input-field textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #1a1a1a;
}

#smx-chat-send {
    background: #6c5ce7;
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

#smx-chat-send:hover:not(:disabled) {
    background: #5b4bc4;
    transform: scale(1.05);
}

#smx-chat-send:disabled {
    background: #333;
    color: #555;
    cursor: not-allowed;
}

.smx-talk-chat-notice {
    font-size: 12px;
    margin-top: 10px;
    color: #ff4757;
    text-align: center;
    min-height: 18px;
}

/* Spinner */
.smx-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid #6c5ce7;
    border-radius: 50%;
    animation: smx-spin 0.8s linear infinite;
}

@keyframes smx-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ON AIR Banner */
.smx-on-air-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 12px 12px 0 0;
    color: #fff;
    margin-bottom: 0;
}

.smx-radio-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.smx-on-air-info {
    flex: 1;
}

.smx-radio-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.smx-on-air-show {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.smx-on-air-label {
    font-weight: 600;
    opacity: 0.9;
}

.smx-show-title {
    font-weight: 500;
}

/* Standalone chat container */
.smx-talk-chat-standalone {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.smx-talk-chat-standalone .smx-talk-chat-container {
    margin-top: 0;
    border-radius: 0 0 12px 12px;
}

.smx-chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
    .smx-talk-chat-container {
        height: 500px;
    }
    
    .smx-message {
        max-width: 95%;
    }
}

