/* Video Protection Styles */
.video-protected {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 90%;
    background-color: transparent;
    z-index: 10;
    cursor: not-allowed;
}

.copy-protected-notice {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.copy-notice-visible {
    opacity: 1;
}

/* Custom video player styles */
.video-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
}

.plyr {
    width: 100% !important;
    height: 100% !important;
}

.plyr__video-wrapper {
    width: 100% !important;
    height: 100% !important;
}

.plyr iframe {
    width: 100% !important;
    height: 100% !important;
}

#video-player-container {
    position: relative;
    overflow: hidden;
    background-color: #000;
}

#custom-video-player {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-controls-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    padding: 5px 10px 10px 10px;
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: 21;
}

#video-player-container:hover .video-controls-container,
#video-player-container .video-controls-container.visible {
    opacity: 1;
}

.video-progress {
    width: 100%;
    height: 5px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
    margin-bottom: 8px;
}

.video-progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    border-radius: 5px;
    transition: width 0.1s linear;
}

.video-controls .fullscreen {
    display: none !important;
}

.video-button {
    background-color: transparent;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.video-button:hover {
    background-color: rgba(255,255,255,0.2);
}

.video-time {
    color: white;
    font-size: 14px;
}

.video-volume {
    display: flex;
    align-items: center;
    width: 120px;
}

.volume-slider {
    width: 60px;
    height: 5px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 5px;
    margin-left: 10px;
    cursor: pointer;
    position: relative;
}

.volume-filled {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    border-radius: 5px;
}

/* Make custom player responsive */
@media (max-width: 768px) {
    .video-volume .volume-slider {
        display: none;
    }

    .video-time {
        font-size: 12px;
    }

    .video-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* WhatsApp-style Chat UI */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 100%;
    padding: 15px;
    background-color: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='90' height='90' viewBox='0 0 90 90' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d9d4cd' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M0 0h90v90H0z'/%3E%3Cpath d='M0 0h45v45H0z'/%3E%3Cpath d='M45 45h45v45H45z'/%3E%3C/g%3E%3C/svg%3E");
    border-radius: 8px;
}

/* Conversation groups */
.conversation-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background-color: rgba(255,255,255,0.5);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Alternating conversation colors */
.conversation-group:nth-child(odd) {
    background-color: rgba(255,255,255,0.7);
}

.conversation-group:nth-child(even) {
    background-color: rgba(255,255,255,0.3);
}

/* Date header for each conversation */
.conversation-date {
    text-align: center;
    font-size: 0.75rem;
    margin-bottom: 10px;
    padding: 5px 10px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 10px;
    color: #333;
    align-self: center;
    font-weight: 500;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.question {
    align-self: flex-start;
}

.chat-message.answer {
    align-self: flex-end;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    word-wrap: break-word;
}

.chat-message.question .chat-bubble {
    background-color: #ffffff;
    border-top-left-radius: 0;
}

.chat-message.question .chat-bubble:before {
    content: "";
    position: absolute;
    top: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid #ffffff;
    border-left: 10px solid transparent;
}

.chat-message.answer .chat-bubble {
    background-color: #dcf8c6;
    border-top-right-radius: 0;
    text-align: left;
}

.chat-message.answer .chat-bubble:before {
    content: "";
    position: absolute;
    top: 0;
    right: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid #dcf8c6;
    border-right: 10px solid transparent;
}

.chat-meta {
    display: flex;
    font-size: 0.7rem;
    color: #6c757d;
    margin-bottom: 2px;
    padding: 0 5px;
}

.chat-message.answer .chat-meta {
    justify-content: flex-end;
}

.chat-attachments {
    margin-top: 8px;
}

/* Timestamp style */
.chat-time {
    font-size: 0.65rem;
    color: #888;
    align-self: flex-end;
    margin-top: 2px;
    margin-right: 5px;
}

/* Pinned answer styles */
.chat-message.answer.pinned .chat-bubble {
    background-color: #c6e2f8;
    border-left: 2px solid #3498db;
}

.chat-message.answer.pinned .chat-bubble:before {
    border-top-color: #c6e2f8;
}

/* Status indicators */
.status-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.65rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-answered {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .chat-message {
        max-width: 85%;
    }
}

/* Bouncing watermark for video area */
.video-watermark {
    position: absolute;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 3px;
    background-color: rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    z-index: 50;
    animation: bounce 15s linear infinite;
    user-select: none;
    pointer-events: none;
}

@keyframes bounce {
    0%, 100% {
        top: 10%;
        left: 10%;
        animation-timing-function: ease-out;
    }
    20% {
        top: 80%;
        left: 30%;
        animation-timing-function: ease-in;
    }
    40% {
        top: 20%;
        left: 70%;
        animation-timing-function: ease-out;
    }
    60% {
        top: 70%;
        left: 80%;
        animation-timing-function: ease-in;
    }
    80% {
        top: 30%;
        left: 20%;
        animation-timing-function: ease-out;
    }
}

/* Second bouncing watermark with different timing */
.video-watermark.second {
    font-size: 14px;
    opacity: 0.8;
    animation: bounce2 18s linear infinite;
}

@keyframes bounce2 {
    0%, 100% {
        top: 20%;
        left: 80%;
        animation-timing-function: ease-in;
    }
    25% {
        top: 70%;
        left: 20%;
        animation-timing-function: ease-out;
    }
    50% {
        top: 30%;
        left: 50%;
        animation-timing-function: ease-in;
    }
    75% {
        top: 80%;
        left: 70%;
        animation-timing-function: ease-out;
    }
}

/* User name styling */
.user-name {
    font-weight: 600;
    color: #333;
}

/* Attachment preview styles */
.card-preview-small {
    max-width: 120px;
    border: 1px solid #ddd;
}

.card-preview-small img {
    max-height: 100px;
    object-fit: cover;
}

.card-preview-medium {
    max-width: 300px;
}

/* Recording animation */
.recording-animation {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Opacity utility */
.opacity-50 {
    opacity: 0.5;
}

/* Hidden utility */
.hidden {
    display: none !important;
}


/* Question Limits Display */
.question-limits-info {
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #0d6efd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.limit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.limit-item strong {
    color: #333;
    margin-right: 10px;
}

.limit-item .badge {
    font-size: 0.85rem;
    padding: 5px 10px;
}

.question-limits-info .alert {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Status badge colors */
.bg-pending {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.bg-approved {
    background-color: #28a745 !important;
    color: #fff !important;
}

.bg-rejected {
    background-color: #dc3545 !important;
    color: #fff !important;
}

/* Responsive question limits */
@media (max-width: 576px) {
    .question-limits-info {
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    .limit-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .limit-item .badge {
        margin-top: 5px;
    }
}
