/* Video Session Styles - Enhanced UI/UX */

.session-paper {
    padding: 1.5rem;
    margin-top: 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
}

.session-paper:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    justify-content: center;
    align-items: start;
}

@media (max-width: 768px) {
    .video-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }
}

.video-position {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.video-position:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.video-element {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    transition: all 0.3s ease;
}

.video-element:hover {
    filter: brightness(1.05);
}

/* Loading state for video */
.video-element[src=""],
.video-element:not([srcObject]) {
    background: linear-gradient(45deg, #1e293b 25%, #334155 25%, #334155 50%, #1e293b 50%, #1e293b 75%, #334155 75%);
    background-size: 40px 40px;
    animation: loading-stripes 2s linear infinite;
}

@keyframes loading-stripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 40px 40px;
    }
}

.session-video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.9) 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    border: 2px solid rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    max-width: 80%;
}

.overlay-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.overlay-subtext {
    font-size: 0.875rem;
    color: #94a3b8;
    opacity: 0.8;
}

.button-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Enhanced MudButton styles */
.button-container .mud-button {
    border-radius: 12px !important;
    padding: 12px 20px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    min-width: 48px !important;
    position: relative !important;
    overflow: hidden !important;
}

.button-container .mud-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.button-container .mud-button:active {
    transform: translateY(0) !important;
}

/* Volume control styling */
.volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 140px;
}

.volume-control:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Enhanced Chat Styles */
.chat-container {
    margin-top: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fefefe;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7);
}

.chat-input {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

/* Enhanced Chat Message Styles */
.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    max-width: 85%;
    position: relative;
    animation: messageSlideIn 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.message:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.message.sent {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 4px;
}

.message.sent::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-bottom-color: #2563eb;
    border-right: none;
    border-bottom-right-radius: 4px;
}

.message.received {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #1e293b;
    margin-right: auto;
    text-align: left;
    border-bottom-left-radius: 4px;
}

.message.received::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-bottom-color: #e2e8f0;
    border-left: none;
    border-bottom-left-radius: 4px;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.8;
}

.message.sent .message-header {
    flex-direction: row-reverse;
}

.username {
    font-weight: 600;
    font-size: 0.8rem;
}

.message.sent .username {
    color: rgba(255, 255, 255, 0.9);
}

.message.received .username {
    color: #3b82f6;
}

.timestamp {
    font-size: 0.7rem;
    opacity: 0.7;
}

.message-content {
    margin-top: 0.25rem;
}

.message-content .text {
    line-height: 1.5;
    font-size: 0.9rem;
    word-wrap: break-word;
}

.message.sent .message-content .text {
    color: rgba(255, 255, 255, 0.95);
}

.message.received .message-content .text {
    color: #1e293b;
}

/* Enhanced Animation Effects */
.pulsing {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Connection Status Indicators */
.connection-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.connection-indicator.connected {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    animation: pulse-green 2s infinite;
}

.connection-indicator.connecting {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    animation: pulse-yellow 2s infinite;
}

.connection-indicator.disconnected {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

@keyframes pulse-yellow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
}

@keyframes pulse-red {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

/* Enhanced Fullscreen Video Styles */
.video-element:fullscreen {
    object-fit: contain;
    background: #000;
    cursor: none;
}

.video-element:-webkit-full-screen {
    object-fit: contain;
    background: #000;
    cursor: none;
}

.video-element:-moz-full-screen {
    object-fit: contain;
    background: #000;
    cursor: none;
}

.video-element:-ms-fullscreen {
    object-fit: contain;
    background: #000;
    cursor: none;
}

/* Responsive Design Enhancements */
@media (max-width: 1200px) {
    .session-paper {
        padding: 1rem;
        margin: 0.5rem;
    }

    .button-container {
        gap: 0.75rem;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .session-paper {
        padding: 1rem;
        margin: 0.5rem 0;
        border-radius: 12px;
    }

    .video-container {
        gap: 1rem;
        margin: 1rem 0;
    }

    .video-position {
        aspect-ratio: 4/3;
    }

    .button-container {
        flex-direction: row;
        gap: 0.5rem;
        padding: 1rem;
        justify-content: space-around;
    }

    .volume-control {
        min-width: 120px;
        padding: 0.5rem 0.75rem;
    }

    .chat-container {
        margin-top: 1rem;
    }

    .chat-messages {
        height: 250px;
        padding: 1rem;
    }

    .message {
        max-width: 90%;
        padding: 0.5rem 0.75rem;
    }

    .overlay-text {
        font-size: 1rem;
    }

    .session-video-overlay {
        padding: 1.5rem;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .video-container {
        grid-template-columns: 1fr;
    }

    .video-position {
        aspect-ratio: 16/10;
    }

    .button-container {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .volume-control {
        order: 1;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .session-video-overlay {
        padding: 1rem;
        border-radius: 12px;
    }

    .overlay-text {
        font-size: 0.9rem;
    }
}

/* Focus and Accessibility Improvements */
.mud-button:focus-visible {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

.video-element:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Video Quality Indicator */
.quality-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.quality-hd {
    color: #10b981;
}

.quality-sd {
    color: #f59e0b;
}

.quality-low {
    color: #ef4444;
}