/* Chat-specific styles */
.chat-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 0 2rem;
}

.chat-controls {
    background: #f8f9fa;
    padding: 2rem 0;
    border-bottom: 1px solid #e9ecef;
}

.join-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-group input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.control-buttons, .media-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-control {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-control:hover {
    background: #5a6268;
}

.btn-control.active {
    background: #28a745;
}

.btn-control.inactive {
    background: #dc3545;
}

.video-chat-container {
    padding: 2rem 0;
    min-height: 600px;
}

.chat-layout {
    display: flex;
    gap: 1rem;
    height: 600px;
}

.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: minmax(200px, 1fr);
    gap: 1rem;
    background: #000;
    border-radius: 10px;
    padding: 1rem;
    overflow: hidden;
}

.local-video-container,
.remote-video-container {
    position: relative;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    min-height: 200px;
}

.local-video-container video,
.remote-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.participant-controls {
    display: flex;
    gap: 0.5rem;
}

.chat-panel {
    width: 300px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    margin: 0;
    font-size: 1rem;
}

#close-chat {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c757d;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    max-height: 400px;
}

.message {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-radius: 5px;
    background: #f8f9fa;
}

.message.own {
    background: #007bff;
    color: white;
    text-align: right;
}

.message-sender {
    font-weight: bold;
    margin-bottom: 4px;
}

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

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.message.encrypted {
    border-left: 3px solid #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.system-message {
    font-style: italic;
    color: #666;
    text-align: center;
    margin: 8px 0;
    padding: 4px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
}

.chat-input input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-right: 0.5rem;
}

.chat-input button {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    cursor: pointer;
}

.connection-status {
    background: #f8f9fa;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
}

.status-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 300px;
    margin: 0 auto;
}

.status-connected {
    color: #28a745;
    font-weight: bold;
}

.status-connecting {
    color: #ffc107;
    font-weight: bold;
}

.status-disconnected {
    color: #dc3545;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-layout {
        flex-direction: column;
        height: auto;
    }

    .chat-panel {
        width: 100%;
        height: 300px;
    }

    .video-grid {
        height: 400px;
        grid-template-columns: 1fr;
    }

    .form-group {
        flex-direction: column;
    }

    .form-group input {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .control-buttons,
    .media-controls {
        flex-direction: column;
        align-items: center;
    }

    .btn-control,
    .btn {
        width: 200px;
    }
}