* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 0px 20px;
    text-align: center;
    position: relative;
    /*margin-right: 10px;*/
}

.chat-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
}

.user-id {
    font-size: 14px;
    opacity: 0.9;
    font-weight: bold;
}

.connection-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-connected {
    background: rgba(46, 204, 113, 0.3);
    color: #27ae60;
}

.status-connecting {
    background: rgba(241, 196, 15, 0.3);
    color: #f39c12;
}

.status-disconnected {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.online-users {
    padding: 5px 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.online-users h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.user-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-badge {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #fafafa;
}

.message {
    margin-bottom: 10px;
    padding: 0px 15px;
    animation: messageSlideIn 0.3s ease-out;
    height: auto;
}

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

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 0px 5px;
}

.message-sender {
    font-weight: bold;
    color: #4facfe;
    margin-right: 10px;
}

.message-time {
    font-size: 12px;
    color: #999;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 70%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message.own .message-content {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    margin-left: auto;
}

.message.own .message-header {
    justify-content: flex-end;
}

.panel-button-container {
  display: flex;
  padding: 0px 20px;
  align-items: center;
  justify-content: center;

  gap: 25px;
  color: #fafafa;
  max-width: 100%;
  background: white;
}

.panel-button {
  display: flex;float: right;
  align-items: center;
  color: #fafafa;
  border-radius: 15px;
  padding: 2px 6px;
  background: linear-gradient(15deg, #fa00fe 0%, #00f400 50%, #0000fe 100%);
  transform: translateY(-2px);
}

.panel-button:hover,
.panel-button:focus {
  background: #00f400;
  color: red;
  cursor: pointer;
}

.panel-button.active {
  background: white;
  color: black;
  cursor: default; /*none*/;
}

.input-container {
    padding: 0px; /*20px;*/
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-row {
    display: flex;
    gap: 0px;
    align-items: center;
    margin: 0px 2px;
}

.file-input-container {
    position: relative;
}

.file-input {
    display: none;
}

.file-button {
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    transition: transform 0.2s ease;
}

.file-button:hover {
    transform: translateY(-2px);
}

.file-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.file-preview-item {
    position: relative;
    max-width: 120px;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 8px;
    border: 2px solid #e0e0e0;
}

.file-preview-item img,
.file-preview-item video {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.file-preview-text {
    font-size: 12px;
    text-align: center;
    margin-top: 5px;
    word-break: break-word;
}

.file-preview-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.message-input:focus {
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.send-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.send-button:hover {
    transform: translateY(-2px);
}

.send-button:active {
    transform: translateY(0);
}

.leave-button {
    padding: 5px 15px;
    background: linear-gradient(135deg, #00f2fe 0%, #ff000e 100%);/*#4facfe 0%, #00f2fe 100%);*/
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.leave-button:hover {
    transform: translateY(2px);
}

.leave-button:active {
    transform: translateY(0);
}

.setup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.setup-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.setup-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.setup-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 16px;
}

.setup-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.message-file {
    margin-top: 10px;
    max-width: 300px;
}

.message-file img,
.message-file video {
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
    cursor: pointer;
}

.message-file video {
    max-height: 200px;
}

.file-download {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.file-download:hover {
    background: rgba(255, 255, 255, 0.2);
}

.file-icon {
    font-size: 24px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: bold;
    font-size: 14px;
}

.file-size {
    font-size: 12px;
    opacity: 0.8;
}

.transfer-progress {
    margin-top: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
}

.transfer-progress-bar {
    height: 100%;
    background: #4facfe;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 10px;
    margin: 10px 0;
    font-size: 14px;
}
.hidden {
  display: none;
}
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
    font-size: 1.5rem;
    flex-direction: column;
    gap: 1rem;
    display: none; /* Hidden by default */
}
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
textarea {
    width: 100%;
    padding: 1px;
}
.videos-container {
  overflow-y: auto;
}
