/* TempSend Styles */

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

:root {
  /* Dark Cozy Theme (Default) */
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary-color: #64748b;
  --success-color: #34d399;
  --error-color: #f87171;
  --warning-color: #fbbf24;
  --bg-color: #1e293b;
  --card-bg: #0f172a;
  --border-color: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --body-bg: #0f172a;
  --body-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--body-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  transition: background 0.3s ease, border-color 0.3s ease;
}

#create-room-section {
  padding: 1.25rem 1.5rem;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  overflow: hidden;
}

/* Desktop: compact 300px container */
@media (min-width: 769px) {
  #create-room-section {
    max-width: 300px;
    width: 300px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  
  #create-room-section h2 {
    text-align: center;
    width: 100%;
    margin-bottom: 1.25rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
  }
  
  #create-room-section .options {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.125rem;
  }
  
  #create-room-section .option-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  #create-room-section .option-row {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    flex-wrap: nowrap;
  }
  
  #create-room-section .option-row > label:not(.toggle-switch) {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    flex-shrink: 0;
    white-space: nowrap;
    min-width: fit-content;
    margin-right: 0;
  }
  
  #create-room-section .option-row select {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    width: 100%;
    margin-left: 0;
  }
  
  #create-room-section .option-row.password-row {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
  }
  
  #create-room-section .option-row.password-row .toggle-switch {
    width: fit-content;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    flex-wrap: nowrap;
  }
  
  #create-room-section .option-row.password-row .toggle-switch span:not(.toggle-slider) {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
  }
  
  #create-room-section .option-row.password-row .lock-icon {
    width: 16px;
    height: 16px;
    margin-left: 0.25rem;
    flex-shrink: 0;
  }
  
  #create-room-section .option-row input[type="password"],
  #create-room-section .option-row input[type="text"] {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    margin-top: 0;
    box-sizing: border-box;
  }
  
  #create-room-section #create-room-btn {
    width: 100%;
    align-self: stretch;
    padding: 0.6875rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
    text-align: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #create-room-section #create-room-btn .btn-text {
    white-space: nowrap;
    text-align: center;
  }
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

#create-room-section h2 {
  font-size: 1.2rem;
  margin-bottom: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: var(--bg-color);
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: var(--card-bg);
}

.upload-area.dragover {
  border-color: var(--primary-color);
  background: var(--card-bg);
  border-style: solid;
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.9);
}

.upload-area p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

/* File Info */
.file-info {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* Upload Section in Room */
.upload-section-in-room {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.upload-section-in-room h3 {
  margin-bottom: 1rem;
}

.upload-section-in-room .upload-area {
  margin-top: 0;
}

.file-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-color);
  border-radius: 8px;
  margin-bottom: 0;
}

/* Room Info Card - Enhanced */
.room-info-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 0;
  box-shadow: var(--shadow-lg);
}

/* Room Info Compact - Horizontal */
.room-info-compact {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 0;
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}

.info-item-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-color);
  border-radius: 8px;
  flex: 1;
  min-width: 120px;
}

.info-icon-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  border-radius: 6px;
  color: white;
  flex-shrink: 0;
}

.info-item-compact:nth-child(2) .info-icon-compact {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.info-item-compact:nth-child(3) .info-icon-compact {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.info-content-compact {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
}

.info-content-compact .info-label-compact {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-content-compact .info-value-compact {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.info-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  border-radius: 10px;
  color: white;
  flex-shrink: 0;
}

.info-item:nth-child(2) .info-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.info-item:nth-child(3) .info-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.info-content .info-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-content .info-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.file-name {
  font-weight: 600;
  color: var(--text-primary);
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 0;
}

#create-room-section .options {
  gap: 1.125rem;
  width: 100%;
  max-width: 100%;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

#create-room-section .option-group {
  gap: 1rem;
  width: 100%;
  max-width: 100%;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

#create-room-section .option-row {
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.option-row > label:not(.toggle-switch) {
  white-space: nowrap;
  min-width: fit-content;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin: 0;
}

#create-room-section .option-row > label:not(.toggle-switch) {
  font-size: 0.9rem;
  font-weight: 500;
  min-width: auto;
  flex-shrink: 0;
  margin-right: 0;
  color: var(--text-primary);
  white-space: nowrap;
}

.option-row select {
  min-width: 180px;
  max-width: 280px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

#create-room-section .option-row select {
  padding: 0.5625rem 0.75rem;
  font-size: 0.9rem;
  min-width: 120px;
  width: auto;
  flex-shrink: 0;
}

.option-row select:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.option-row select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.option-row input[type="password"],
.option-row input[type="text"] {
  min-width: 220px;
  max-width: 320px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

#create-room-section .option-row.password-row {
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#create-room-section .option-row.password-row .toggle-switch {
  margin-bottom: 0;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

#create-room-section .lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 0.25rem;
  flex-shrink: 0;
}

#create-room-section .lock-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

#create-room-section .option-row input[type="password"],
#create-room-section .option-row input[type="text"] {
  padding: 0.5625rem 0.75rem;
  font-size: 0.9rem;
  margin-top: 0.375rem;
  border-radius: 6px;
  box-sizing: border-box;
  align-self: center;
  max-width: 100%;
  transition: all 0.3s ease;
}

#create-room-section .option-row input[type="password"].error-glow,
#create-room-section .option-row input[type="text"].error-glow {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.3), 0 0 20px rgba(248, 113, 113, 0.5);
  animation: errorPulse 1s ease-in-out infinite;
}

@keyframes errorPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.3), 0 0 20px rgba(248, 113, 113, 0.5);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.5), 0 0 30px rgba(248, 113, 113, 0.7);
  }
}

/* Desktop: ensure password field doesn't exceed button width */
@media (min-width: 769px) {
  #create-room-section .option-row input[type="password"],
  #create-room-section .option-row input[type="text"] {
    max-width: fit-content;
  }
}

.option-row input[type="password"]:hover,
.option-row input[type="text"]:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.option-row input[type="password"]:focus,
.option-row input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.option-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.option-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.option-group select,
.option-group input[type="number"] {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  min-width: 150px;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.option-group select option {
  background: var(--card-bg);
  color: var(--text-primary);
}

.option-group select:disabled,
.option-group input[type="number"]:disabled {
  background: var(--bg-color);
  cursor: not-allowed;
  opacity: 0.5;
}

.actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Room Actions - positioned above upload section */
.room-actions-top {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Room Actions - below room-info */
.room-actions-below {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-icon svg {
  flex-shrink: 0;
}

/* Ensure icon buttons have proper sizing */
.btn-icon.btn-small {
  padding: 0.5rem;
  min-width: 36px;
  min-height: 36px;
  width: auto;
  height: auto;
}

/* Upload Actions - inside file-info section */
.upload-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  justify-content: space-between;
  align-items: center;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
  transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(107, 114, 128, 0.3);
}

.btn-enhanced {
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.btn-icon:not(.btn-primary) {
  padding: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
}

.btn-icon:not(.btn-primary):hover {
  background: var(--bg-color);
  color: var(--text-primary);
}

/* Share button - same styling as room options button */
#share-btn-header {
  /* Uses same styles as .btn-icon.btn-small */
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 10;
  position: relative;
}

/* Remove tap highlight from icon buttons */
.btn-icon,
.btn-icon-small {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Progress */
.progress {
  margin-top: 1.5rem;
}

.progress-bar {
  height: 8px;
  background: var(--primary-color);
  border-radius: 4px;
  transition: width 0.3s ease;
  margin-bottom: 0.5rem;
}

.progress-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Success Message */
.success-message {
  margin-top: 1.5rem;
}

.success-message h3 {
  color: var(--success-color);
  margin-bottom: 1rem;
}

.share-link {
  margin: 1.5rem 0;
}

.share-link label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.link-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.link-container input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: monospace;
  background: var(--card-bg);
  color: var(--text-primary);
}

.warning {
  color: var(--warning-color);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Download Section */
.download-info {
  margin-bottom: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.info-value {
  color: var(--text-primary);
}

/* Override for room info card */
.room-info-card .info-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.room-info-card .info-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Chat Section */
.chat-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.chat-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-icon-small {
  padding: 0.5rem;
  min-width: auto;
}

.chat-wrapper {
  display: flex;
  position: relative;
  gap: 1rem;
}

.users-sidebar {
  width: 250px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  max-height: 600px;
  overflow: hidden;
}

.users-sidebar.hidden {
  display: none;
}

.users-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
}

.users-sidebar-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-container {
  flex: 1;
  min-width: 0;
}

.users-list {
  padding: 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.users-list-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.user-item:hover {
  background: var(--bg-color);
}

.user-menu-btn {
  margin-left: auto;
  padding: 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.2s ease;
}

.user-menu-btn:hover {
  background: var(--bg-color);
  color: var(--text-primary);
}

.pm-notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--error-color);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.5rem;
  min-width: 18px;
  height: 18px;
  vertical-align: middle;
}

.pm-notification-badge.hidden {
  display: none !important;
}

.uploaded-file-uploader {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.chat-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  -webkit-overflow-scrolling: touch;
}

.chat-tabs::-webkit-scrollbar {
  height: 4px;
}

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

.chat-tabs::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.chat-tab {
  padding: 0.5rem 1rem;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.chat-tab:hover {
  background: var(--card-bg);
}

.chat-tab.active {
  background: var(--primary-color);
  color: white;
}

.chat-tab.has-unread-pm {
  border-color: var(--error-color);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.3);
  animation: pm-glow 2s ease-in-out infinite alternate;
}

/* Room name display - allow scrolling if too long */
#room-name-display {
  position: relative;
  overflow: hidden;
  justify-content: center; /* Center by default */
}

/* When room options button is visible, use space-between */
#room-name-display:has(#room-options-btn:not(.hidden)) {
  justify-content: space-between;
}

#room-name-text {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  flex: 1;
  max-width: 100%;
}

#room-name-text::-webkit-scrollbar {
  height: 4px;
}

#room-name-text::-webkit-scrollbar-track {
  background: transparent;
}

#room-name-text::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

#room-name-text-inner {
  white-space: nowrap;
}

/* Ensure buttons don't grow */
#share-btn-header,
#room-options-btn {
  flex-shrink: 0;
  width: auto;
  min-width: auto;
}

/* Make room name clickable when editable */
#room-name-text[style*="cursor: pointer"] {
  transition: opacity 0.2s ease;
}

#room-name-text[style*="cursor: pointer"]:hover {
  opacity: 0.8;
}

@keyframes pm-glow {
  from {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.3);
  }
  to {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.7), 0 0 30px rgba(239, 68, 68, 0.5);
  }
}

.close-private-tab {
  display: inline;
  margin-left: 0.5rem;
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.close-private-tab:hover {
  opacity: 1;
}

.chat-container {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.chat-messages {
  height: 300px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 8px;
  max-width: 80%;
  min-width: 200px;
  box-shadow: var(--shadow);
  color: var(--text-primary);
}

.chat-message.own-message {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  max-width: 80%;
  min-width: 200px;
}

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

.chat-username {
  font-weight: 600;
}

.chat-time {
  font-size: 0.7rem;
  opacity: 0.7;
}

.chat-message-text {
  word-wrap: break-word;
  line-height: 1.5;
}

.chat-message.error-message {
  opacity: 0.7;
  border-left: 3px solid var(--error-color);
}

.chat-message.error-message .chat-message-text {
  font-style: italic;
  color: var(--text-secondary);
}

.clickable-username {
  cursor: pointer;
  color: var(--primary-color);
  font-weight: 600;
  transition: color 0.2s ease;
}

.clickable-username:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.mention {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
}

[data-theme="dark"] .mention {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.mention.own-mention {
  background: rgba(37, 99, 235, 0.2);
  color: var(--primary-color);
}

[data-theme="dark"] .mention.own-mention {
  background: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

.mention-self {
  background: rgba(59, 130, 246, 0.2);
  font-weight: 600;
}

.mention:hover {
  background: rgba(37, 99, 235, 0.2);
}

.mention.own-mention:hover {
  background: rgba(37, 99, 235, 0.3);
}

/* Sender's username - always white (message has blue gradient background) */
.own-username {
  color: white !important;
}

/* Receiver's username - darker in light mode, lighter in dark mode */
.chat-message:not(.own-message) .chat-username {
  color: var(--text-primary);
}

/* In dark mode, make receiver's username more visible */
[data-theme="dark"] .chat-message:not(.own-message) .chat-username {
  color: var(--text-secondary);
}

.user-context-menu {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  min-width: 180px;
}

.context-menu-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.context-menu-item:hover {
  background: var(--bg-color);
}

.context-menu-item:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.context-menu-item:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.context-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.context-menu-item-danger {
  color: var(--error-color);
  font-weight: 600;
}

.context-menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-color);
  border-top: 1px solid var(--border-color);
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
  background: var(--card-bg);
  color: var(--text-primary);
}

.chat-input:focus {
  border-color: var(--primary-color);
}

.chat-input::placeholder {
  color: var(--text-tertiary);
}

.chat-send-btn {
  padding: 0.75rem 1.25rem;
  min-width: auto;
}

/* Image Preview */
.image-preview-container {
  margin-bottom: 2rem;
  text-align: center;
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.image-preview {
  max-width: 100%;
  max-height: 600px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  object-fit: contain;
}

/* Error Message */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--error-color);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Share menu styling - ensure it shows when not hidden */
#share-menu-header.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

#share-menu-header:not(.hidden) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important; /* Use fixed to escape parent stacking context */
  z-index: 999999 !important; /* Extremely high z-index to ensure it's on top of everything */
  height: auto !important;
  overflow: visible !important;
  background: var(--bg-color, #1e293b) !important;
  border: 1px solid var(--border-color, #334155) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  min-width: 150px !important;
}

/* Share menu items - ensure they're visible */
.share-menu-item {
  color: var(--text-color, #f1f5f9) !important;
  background: transparent !important;
}

.share-menu-item:hover {
  background: var(--card-bg, #334155) !important;
}

.share-menu-item svg {
  color: var(--text-color, #f1f5f9) !important;
}

.share-menu-item span {
  color: var(--text-color, #f1f5f9) !important;
}

/* Room options menu - same styling as share menu */
#room-options-menu {
  position: fixed !important;
  z-index: 99999 !important;
  background: var(--bg-color, #1e293b) !important;
  border: 1px solid var(--border-color, #334155) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  min-width: 150px !important;
  padding: 0 !important;
}

.room-options-menu-item {
  color: var(--text-color, #f1f5f9) !important;
  background: transparent !important;
}

.room-options-menu-item:hover {
  background: var(--card-bg, #334155) !important;
}

.room-options-menu-item svg {
  color: var(--text-color, #f1f5f9) !important;
}

.room-options-menu-item span {
  color: var(--text-color, #f1f5f9) !important;
}

.room-options-menu-item-danger {
  color: var(--error-color, #ef4444) !important;
}

.room-options-menu-item-danger svg {
  color: var(--error-color, #ef4444) !important;
}

.room-options-menu-item-danger span {
  color: var(--error-color, #ef4444) !important;
}

/* Footer */
footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 3rem;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--primary-color);
}

footer code {
  user-select: all;
  cursor: text;
}

/* Security Details */
#security-details {
  margin-bottom: 1.5rem;
}

.security-details-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  transition: all 0.2s ease;
}

.security-badge:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(51, 65, 85, 0.7);
  transform: translateY(-1px);
}

.security-badge-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.security-icon-check,
.security-icon-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  flex-shrink: 0;
}

.security-icon-x {
  background: rgba(239, 68, 68, 0.15);
}

.security-icon-check svg,
.security-icon-x svg {
  display: block;
}

.security-help-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.security-help-link:hover {
  color: var(--primary-color);
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateY(-1px);
}

.security-help-link svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.security-help-link:hover svg {
  transform: scale(1.1);
}

/* Files Preview Grid */
.files-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.file-preview-item {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-preview-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.file-preview-thumbnail {
  position: relative;
  width: 100%;
  height: 150px;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.file-preview-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-thumbnail .file-icon {
  width: 48px;
  height: 48px;
  color: var(--text-secondary);
}

.file-remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.file-remove-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.file-preview-info {
  padding: 0.75rem;
}

.file-preview-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.file-preview-size {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Uploaded Files Grid */
.uploaded-files-grid,
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  transition: opacity 0.2s ease;
}

.uploaded-file-item {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.uploaded-file-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.uploaded-file-thumbnail {
  width: 100%;
  height: 200px;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.file-uploader-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 10;
}

.vote-count-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 10;
  min-width: 2rem;
  text-align: center;
}

.vote-count-badge.positive {
  background: rgba(16, 185, 129, 0.8);
  color: white;
}

.vote-count-badge.negative {
  background: rgba(239, 68, 68, 0.8);
  color: white;
}

.vote-count-badge.firey {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  color: white;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6), 0 0 20px rgba(245, 158, 11, 0.4);
  animation: firey-glow 2s ease-in-out infinite alternate;
}

.pin-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(59, 130, 246, 0.9);
  backdrop-filter: blur(4px);
  color: white;
  padding: 0.25rem;
  border-radius: 4px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  width: auto;
  height: auto;
  min-width: auto;
  min-height: auto;
  pointer-events: none;
}

.pin-badge svg {
  width: 16px;
  height: 16px;
  display: block;
}

@keyframes firey-glow {
  from {
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.6), 0 0 20px rgba(245, 158, 11, 0.4);
  }
  to {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.8), 0 0 30px rgba(245, 158, 11, 0.6), 0 0 40px rgba(217, 119, 6, 0.4);
  }
}

.uploaded-file-item.firey {
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.5), 0 0 30px rgba(245, 158, 11, 0.3), 0 0 45px rgba(217, 119, 6, 0.2);
  border: 2px solid rgba(251, 191, 36, 0.6);
  animation: golden-glow 2s ease-in-out infinite alternate;
}

@keyframes golden-glow {
  from {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5), 0 0 30px rgba(245, 158, 11, 0.3), 0 0 45px rgba(217, 119, 6, 0.2);
    border-color: rgba(251, 191, 36, 0.6);
  }
  to {
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.7), 0 0 40px rgba(245, 158, 11, 0.5), 0 0 60px rgba(217, 119, 6, 0.3);
    border-color: rgba(251, 191, 36, 0.8);
  }
}

.uploaded-file-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploaded-file-thumbnail .file-icon {
  width: 64px;
  height: 64px;
  color: var(--text-secondary);
}

.uploaded-file-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  pointer-events: none;
}

.video-play-overlay svg {
  width: 30px;
  height: 30px;
  margin-left: 4px; /* Center the play icon */
}

.uploaded-file-thumbnail {
  position: relative;
}

.uploaded-file-info {
  padding: 1rem;
}

.uploaded-file-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.5rem;
}

.uploaded-file-size {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.uploaded-file-expiry {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
}

.btn-report-abuse {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.95);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-report-abuse:hover {
  background: rgba(239, 68, 68, 1);
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-report-abuse svg {
  width: 18px;
  height: 18px;
}

.uploaded-file-info {
  position: relative;
}

.uploaded-file-item {
  position: relative;
}

/* Alternative: Report button in thumbnail overlay */
.uploaded-file-thumbnail {
  position: relative;
}

.uploaded-file-thumbnail:hover .btn-options-overlay {
  opacity: 1;
}

.btn-options-overlay {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
  opacity: 0.8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-options-overlay:hover {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-options-overlay:active {
  transform: scale(0.95);
}

.btn-options-overlay svg {
  width: 14px;
  height: 14px;
}

.file-options-menu {
  position: fixed !important; /* Use fixed to escape parent stacking context */
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow-lg) !important;
  z-index: 999999 !important; /* Extremely high z-index to ensure it's on top of everything */
  min-width: 150px !important;
  overflow: hidden !important;
  padding: 0 !important;
}

/* Copy warning styling */
.copy-warning {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.15);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
  z-index: 10000;
  max-width: 90%;
  text-align: center;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.file-option-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
  text-align: left;
}

.file-option-item:hover {
  background: var(--bg-color);
}

.file-option-item.file-option-danger {
  color: var(--error-color);
}

.file-option-item.file-option-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.file-option-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Full Screen Modal */
.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-modal.hidden {
  display: none;
}

.modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 3.5rem;
  box-sizing: border-box;
}

.modal-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1001;
  border-bottom: none;
  min-height: 3.5rem;
  box-sizing: border-box;
}

.modal-top-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.modal-top-info .modal-filename {
  font-size: 0.95rem;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-top-info .modal-details {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.modal-top-info .modal-index {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.modal-vote-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.75rem;
}

.modal-vote-container .vote-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.modal-vote-container .vote-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-vote-container .vote-btn.active {
  background: rgba(59, 130, 246, 0.3);
}

.modal-vote-container .vote-btn svg {
  width: 16px;
  height: 16px;
}

.modal-vote-container .vote-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  min-width: 2rem;
  text-align: center;
  flex-shrink: 0;
}

.modal-top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-download-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

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

.modal-download-icon svg {
  width: 18px;
  height: 18px;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 1001;
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-nav-prev {
  left: 2rem;
}

.modal-nav-next {
  right: 2rem;
}

.modal-image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem;
  overflow: auto;
  box-sizing: border-box;
}

.modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: opacity 0.2s ease;
}

.modal-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.modal-pdf {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

.hidden {
  display: none !important;
}


/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1rem 0.5rem;
  }

  header h1 {
    font-size: 2rem;
  }

  .card {
    padding: 1.5rem;
  }

  .file-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .option-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .option-group select,
  .option-group input[type="number"] {
    width: 100%;
  }

  .files-preview {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }

  .uploaded-files-grid,
  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .modal-nav {
    width: 40px;
    height: 40px;
  }

  .modal-nav-prev {
    left: 1rem;
  }

  .modal-nav-next {
    right: 1rem;
  }

  .modal-top-bar {
    padding: 0.5rem 1rem;
    min-height: 3rem;
  }

  .modal-top-info {
    gap: 0.5rem;
  }

  .modal-top-info .modal-filename {
    font-size: 0.875rem;
  }

  .modal-top-info .modal-details {
    font-size: 0.7rem;
  }

  .modal-top-info .modal-index {
    font-size: 0.7rem;
  }

  .modal-content {
    padding-top: 3rem;
  }

  .modal-vote-container .vote-btn {
    width: 28px;
    height: 28px;
  }

  .modal-vote-container .vote-btn svg {
    width: 14px;
    height: 14px;
  }

  .modal-download-icon,
  .modal-close {
    width: 32px;
    height: 32px;
  }

  .modal-download-icon svg {
    width: 16px;
    height: 16px;
  }

  .modal-close {
    font-size: 20px;
  }

  .modal-image-container {
    padding: 0.5rem;
  }
}

/* Custom Modal Dialogs */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal.hidden {
  display: none;
}

.custom-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.custom-modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  z-index: 2001;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.custom-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.custom-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.custom-modal-body {
  padding: 1.5rem;
}

.custom-modal-body p {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.6;
}

.custom-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Vote System */
.uploaded-file-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.file-info-left {
  flex: 1;
  min-width: 0;
}

.vote-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.vote-btn {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.vote-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.vote-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.vote-btn:hover {
  background: var(--bg-color);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: scale(1.1);
}

.vote-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.vote-btn.vote-up.active {
  background: var(--success-color);
  border-color: var(--success-color);
}

.vote-btn.vote-down.active {
  background: var(--error-color);
  border-color: var(--error-color);
}

.vote-btn svg {
  width: 20px;
  height: 20px;
}

.vote-count {
  font-size: 1rem;
  font-weight: 600;
  min-width: 2rem;
  text-align: center;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.vote-count.positive {
  color: var(--success-color);
}

.vote-count.negative {
  color: var(--error-color);
}

.vote-count.neutral {
  color: var(--text-tertiary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch span:not(.toggle-slider) {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

#create-room-section .toggle-switch {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

#create-room-section .toggle-switch span:not(.toggle-slider) {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  background-color: var(--border-color);
  border-radius: 26px;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#create-room-section .toggle-slider {
  width: 44px;
  height: 24px;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#create-room-section .toggle-slider::before {
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

#create-room-section .toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-switch:hover .toggle-slider {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

