/* Reset and base styles */
* {
  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%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
  color: white;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Cards and sections */
.menu-card, .lobby-card, .game-over-card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-width: 500px;
  margin: 0 auto;
}

.menu, .lobby, .game-over {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

/* Form inputs */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin: 5px;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

/* Lobby styles */
.room-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.room-id {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #667eea;
  font-size: 1.2rem;
}

.players-section {
  margin: 20px 0;
}

.players-section h3 {
  margin-bottom: 10px;
  color: #555;
}

#playersList {
  list-style: none;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
}

#playersList li {
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

#playersList li:last-child {
  border-bottom: none;
}

.connection-status {
  text-align: center;
  margin: 20px 0;
}

#connectionStatus {
  font-weight: bold;
  color: #667eea;
}

/* Ready section */
.ready-section {
  margin: 20px 0;
  text-align: center;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.ready-status {
  margin-top: 10px;
}

#readyStatusText {
  font-size: 0.95rem;
  color: #666;
  margin: 0;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

.player-item:last-child {
  border-bottom: none;
}

.player-name {
  font-weight: 500;
}

.player-name.host {
  color: #667eea;
  font-weight: 600;
}

.player-name.you {
  font-weight: 600;
}

.player-status {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 0.85rem;
}

.connection-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.connection-indicator.connected {
  background: #28a745;
}

.connection-indicator.connecting {
  background: #ffc107;
}

.ready-indicator {
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
}

.ready-indicator.ready {
  background: #d4edda;
  color: #155724;
}

.ready-indicator.not-ready {
  background: #f8d7da;
  color: #721c24;
}

/* Host controls */
.host-controls {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px;
  border-radius: 8px;
  margin: 10px 0;
}

.host-controls h4 {
  margin: 0 0 10px 0;
  font-size: 1rem;
}

.host-controls p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Lobby chat styles */
.lobby-chat {
  margin: 20px 0;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
}

.lobby-chat h3 {
  margin: 0 0 10px 0;
  color: #555;
  font-size: 1rem;
}

.lobby-chat-messages {
  height: 150px;
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #e9ecef;
}

/* Drawing area */
.drawing-area {
  text-align: center;
}

.drawing-info {
  background: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.drawing-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group label {
  font-weight: 600;
  color: #555;
}

.control-group select, .control-group input[type="range"] {
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

#brushSizeDisplay {
  min-width: 30px;
  font-weight: 600;
  color: #667eea;
}

/* Main drawing container with canvas and chat */
.main-drawing-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

.canvas-container {
  position: relative;
}

/* Chat styles */
.chat-container {
  width: 300px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  height: 600px;
}

.chat-container.hidden {
  display: none;
}

.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f8f9fa;
  border-left: 1px solid #e9ecef;
  border-right: 1px solid #e9ecef;
}

.chat-message {
  margin-bottom: 10px;
  word-wrap: break-word;
}

.chat-message.system {
  text-align: center;
  font-style: italic;
  color: #6c757d;
  font-size: 0.9rem;
}

.chat-message.user {
  background: #e3f2fd;
  padding: 8px 12px;
  border-radius: 15px;
  margin-left: 20px;
}

.chat-message.other {
  background: #f1f3f4;
  padding: 8px 12px;
  border-radius: 15px;
  margin-right: 20px;
}

.message-sender {
  font-weight: bold;
  font-size: 0.85rem;
  color: #667eea;
  margin-bottom: 2px;
  display: block;
}

.message-text {
  display: block;
  line-height: 1.4;
}

.message-time {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 2px;
  display: block;
}

.chat-input-container {
  padding: 15px;
  background: white;
  border-radius: 0 0 10px 10px;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 10px;
}

#chatInput {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
}

#chatInput:focus {
  border-color: #667eea;
}

#sendMessage {
  padding: 8px 16px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Show chat button (floating) */
.show-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  z-index: 1000;
  transition: all 0.3s ease;
}

.show-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.show-chat-button.hidden {
  display: none;
}

/* Color palette */
.color-palette {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.color-option {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.active {
  border-color: #667eea;
  transform: scale(1.2);
}

.color-option[data-color="#ffffff"] {
  border: 3px solid #ccc;
}

#colorPicker {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.drawing-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Canvas container */
.canvas-container {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.turn-indicator {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  display: none;
  z-index: 10;
}

.turn-indicator.active {
  display: block;
}

.turn-indicator.your-turn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.turn-indicator.other-turn {
  background: #ffc107;
  color: #333;
}

.turn-timer {
  font-size: 0.9rem;
  font-weight: bold;
  margin-top: 5px;
  text-align: center;
}

/* Canvas */
#drawingCanvas {
  border: 3px solid #333;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

#drawingCanvas.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.1);
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 10px;
}

.canvas-overlay.active {
  display: flex;
}

.drawing-instructions {
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.drawing-instructions p {
  margin: 5px 0;
  color: #666;
}

/* Session over */
.session-over {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.session-over-card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

#sessionSummary {
  margin: 20px 0;
}

#finalArtwork {
  border: 2px solid #ddd;
  border-radius: 8px;
  margin: 10px auto;
  display: block;
}

/* Notifications */
.notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.notification {
  background: white;
  border-left: 4px solid #667eea;
  padding: 15px 20px;
  margin-bottom: 10px;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  max-width: 300px;
  animation: slideIn 0.3s ease;
}

.notification.success {
  border-left-color: #28a745;
}

.notification.error {
  border-left-color: #dc3545;
}

.notification.warning {
  border-left-color: #ffc107;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

.text-center {
  text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .menu-card, .lobby-card, .game-over-card {
    padding: 20px;
    margin: 10px;
  }

  .main-drawing-container {
    flex-direction: column;
    align-items: center;
  }

  .chat-container {
    width: 100%;
    max-width: 500px;
    height: 300px;
    order: 2;
  }

  .canvas-container {
    order: 1;
  }
  
  #drawingCanvas {
    width: 100%;
    height: auto;
  }
  
  .drawing-info {
    padding: 15px;
  }
  
  .drawing-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .color-palette {
    gap: 5px;
  }
  
  .drawing-actions {
    flex-direction: column;
  }

  .show-chat-button {
    bottom: 10px;
    right: 10px;
    padding: 10px 16px;
    font-size: 13px;
  }
} 