/**
 * Stream Chat Manager - Frontend CSS
 */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

/* Container */
.scm-container {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    font-family: 'Be Vietnam Pro', sans-serif;
}

.scm-layout-horizontal {
    flex-direction: row;
}

.scm-layout-vertical {
    flex-direction: column;
}

/* Stream Wrapper */
.scm-stream-wrapper {
    flex: 3;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scm-stream-wrapper[data-ratio="16:9"] {
    aspect-ratio: 16 / 9;
}

.scm-stream-wrapper[data-ratio="4:3"] {
    aspect-ratio: 4 / 3;
}

.scm-stream-wrapper[data-ratio="1:1"] {
    aspect-ratio: 1 / 1;
}

.scm-stream-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.scm-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.scm-placeholder p {
    font-size: 18px;
    font-weight: 500;
}

/* Chat Wrapper */
.scm-chat-wrapper {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    height: 435px;
    background: #1a1f28;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scm-layout-horizontal .scm-chat-wrapper {
    min-height: 200px;
}

.scm-layout-vertical .scm-chat-wrapper {
    width: 100% !important;
    min-height: 400px;
}

.scm-chat-iframe {
    width: 100%;
    height: 100%;
    min-height: 200px;
    border: none;
}

/* Buttons Container */
.scm-buttons-wrapper {
    position: relative;
    margin: 20px 0;
}

@media screen and (max-width: 768px) {
    .scm-chat-wrapper {
        height: 600px !important;
        min-height: 400px;
    }
}

.scm-buttons-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 0 6px 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Hint Text */
.scm-hint {
    display: none;
    font-size: 11px;
    color: #6b7280;
    font-family: 'Be Vietnam Pro', sans-serif;
    margin: 0;
    padding: 0 5px;
    opacity: 0.8;
    font-style: italic;
    text-align: center;
}

/* Scrollbar styling */
.scm-buttons-container::-webkit-scrollbar {
    height: 8px;
}

.scm-buttons-container::-webkit-scrollbar-track {
    background: #1a1f28;
    border-radius: 4px;
}

.scm-buttons-container::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

.scm-buttons-container::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Channel Buttons - Default Style */
.scm-style-default .scm-channel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    min-width: 100px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    white-space: nowrap;
}

.scm-style-default .scm-channel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.5);
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
}

.scm-style-default .scm-channel-btn:active {
    transform: translateY(0);
}

.scm-style-default .scm-channel-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Channel Buttons - Pills Style */
.scm-style-pills .scm-channel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    min-width: 90px;
    flex-shrink: 0;
    background: #1a1f28;
    color: #e4e6eb;
    border: 2px solid #2d333b;
    border-radius: 50px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.scm-style-pills .scm-channel-btn:hover {
    border-color: #3b82f6;
    color: #60a5fa;
    background: #2d333b;
}

.scm-style-pills .scm-channel-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.4);
}

/* Channel Buttons - Minimal Style */
.scm-style-minimal .scm-channel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    min-width: 80px;
    flex-shrink: 0;
    background: transparent;
    color: #9ca3af;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.scm-style-minimal .scm-channel-btn:hover {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.scm-style-minimal .scm-channel-btn.active {
    color: #e4e6eb;
    border-bottom-color: #10b981;
}

/* Button Icon */
.scm-btn-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

/* Loading State */
.scm-channel-btn.loading {
    opacity: 0.6;
    cursor: wait;
}

.scm-channel-btn.loading .scm-btn-text::after {
    content: '...';
    animation: scm-dots 1.5s infinite;
}

@keyframes scm-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive */
@media (max-width: 1024px) {
    .scm-layout-horizontal {
        flex-direction: column;
    }
    
    .scm-stream-wrapper {
        flex: none;
    }
    
    .scm-chat-wrapper {
        flex: none;
        width: 100% !important;
        max-width: 100%;
        height: 400px;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .scm-container {
        gap: 10px;
    }
    
    .scm-buttons-container {
        gap: 6px;
    }
    
    .scm-channel-btn {
        font-size: 12px;
        padding: 7px 14px;
        min-width: 85px;
    }
    
    .scm-hint {
        display: block;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .scm-container {
        gap: 8px;
        margin: 10px 0;
    }
    
    .scm-buttons-wrapper {
        margin: 10px 0;
    }
    
    .scm-buttons-container {
        gap: 6px;
    }
    
    .scm-channel-btn {
        font-size: 11px !important;
        padding: 6px 12px !important;
        min-width: 70px !important;
        gap: 4px;
    }
    
    .scm-btn-icon {
        font-size: 14px;
    }
    
    .scm-hint {
        font-size: 9px;
        padding: 0 2px;
    }
    
    .scm-stream-wrapper {
        min-height: 250px;
        border-radius: 6px;
    }
    
    .scm-chat-wrapper {
        border-radius: 6px;
    }
    
    .scm-buttons-container::-webkit-scrollbar {
        height: 4px;
    }
}

/* Animation */
.scm-fade-in {
    animation: scmFadeIn 0.3s ease-in-out;
}

@keyframes scmFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===============================================
   RESUME MODAL
   =============================================== */

.scm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scmModalFadeIn 0.3s ease;
}

@keyframes scmModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.scm-modal {
    background: #1a1f28;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: scmModalSlideUp 0.3s ease;
}

@keyframes scmModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scm-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.scm-modal-header h3 {
    color: #e4e6eb;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.scm-modal-body {
    text-align: center;
}

.scm-modal-body p {
    color: #9ca3af;
    font-size: 15px;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.scm-modal-body strong {
    color: #3b82f6;
    font-weight: 600;
}

.scm-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scm-modal-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Be Vietnam Pro', sans-serif;
}

.scm-modal-resume {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    margin-bottom: 16px;
}

.scm-modal-resume:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.scm-modal-divider {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    margin: 16px 0;
    position: relative;
}

.scm-modal-divider::before,
.scm-modal-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: rgba(107, 114, 128, 0.3);
}

.scm-modal-divider::before {
    left: 0;
}

.scm-modal-divider::after {
    right: 0;
}

.scm-modal-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 0;
}

.scm-modal-channels .scm-channel-btn {
    min-width: 90px;
    padding: 10px 16px;
    font-size: 13px;
}

.scm-modal-channels::-webkit-scrollbar {
    width: 6px;
}

.scm-modal-channels::-webkit-scrollbar-track {
    background: #0f1419;
    border-radius: 3px;
}

.scm-modal-channels::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

.scm-modal-channels::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Modal mobile responsive */
@media (max-width: 480px) {
    .scm-modal {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .scm-modal-header h3 {
        font-size: 18px;
    }
    
    .scm-modal-body p {
        font-size: 13px;
    }
    
    .scm-modal-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .scm-modal-divider {
        font-size: 12px;
    }
    
    .scm-modal-channels {
        max-height: 150px;
    }
    
    .scm-modal-channels .scm-channel-btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 12px;
    }
}
