/* ==========================================================================
   Hackathon Workspace Theme & Styles
   ========================================================================== */

:root {
  --h-primary: #0062E6;          /* Vibrant Blue */
  --h-primary-hover: #004dc0;
  --h-primary-light: #F0F6FF;
  --h-accent: #FFD200;           /* Energetic Yellow */
  --h-accent-light: #FFFBE6;
  --h-bg-white: #FFFFFF;
  --h-bg-offset: #F8FAFC;
  --h-text-main: #0F172A;        /* Slate 900 */
  --h-text-muted: #475569;       /* Slate 600 */
  --h-text-light: #94A3B8;       /* Slate 400 */
  --h-border: #E2E8F0;           /* Slate 200 */
  --h-success: #10B981;          /* Emerald 500 */
  
  --h-shadow: 0 10px 30px rgba(0, 98, 230, 0.05);
  --h-shadow-lg: 0 20px 40px rgba(0, 98, 230, 0.1);
  --h-radius: 12px;
  --h-radius-lg: 16px;
  --h-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hackathon-workspace-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--h-text-main);
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

/* ==========================================================================
   Common Cards & Components
   ========================================================================== */
.hackathon-card {
  background: var(--h-bg-white);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-lg);
  box-shadow: var(--h-shadow);
  padding: 30px;
  margin-bottom: 24px;
  transition: var(--h-transition);
}

.hackathon-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--h-border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.hackathon-card-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--h-text-main);
}

/* Buttons */
.hackathon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--h-transition);
  font-size: 0.9rem;
}

.hackathon-btn-primary {
  background-color: var(--h-primary);
  color: var(--h-bg-white);
}

.hackathon-btn-primary:hover {
  background-color: var(--h-primary-hover);
  transform: translateY(-1px);
}

.hackathon-btn-secondary {
  background-color: var(--h-bg-offset);
  border-color: var(--h-border);
  color: var(--h-text-muted);
}

.hackathon-btn-secondary:hover {
  background-color: var(--h-primary-light);
  border-color: var(--h-primary);
  color: var(--h-primary);
}

.hackathon-btn-outline {
  background: transparent;
  border-color: var(--h-border);
  color: var(--h-text-muted);
}

.hackathon-btn-outline:hover {
  border-color: var(--h-primary);
  color: var(--h-primary);
  background-color: var(--h-primary-light);
}

.hackathon-btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem;
}

/* ==========================================================================
   1. Unlock / Access Form
   ========================================================================== */
.hackathon-unlock-card {
  max-width: 460px;
  margin: 60px auto;
  text-align: center;
}

.hackathon-lock-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: inline-block;
}

.hackathon-unlock-header h2 {
  font-size: 1.5rem;
  margin: 0 0 10px 0;
  font-weight: 700;
}

.hackathon-unlock-header p {
  color: var(--h-text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.hackathon-form-group {
  text-align: left;
  margin-bottom: 20px;
}

.hackathon-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.hackathon-form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  font-size: 1rem;
  transition: var(--h-transition);
  background-color: var(--h-bg-offset);
}

.hackathon-form-group input:focus {
  outline: none;
  border-color: var(--h-primary);
  background-color: var(--h-bg-white);
  box-shadow: 0 0 0 3px rgba(0, 98, 230, 0.15);
}

.hackathon-error-msg {
  color: #b32d2e;
  font-size: 0.8rem;
  margin-top: 6px;
  display: block;
}

/* ==========================================================================
   2. Workspace Dashboard Layout
   ========================================================================== */
.hackathon-workspace-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
}

.hackathon-workspace-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--h-bg-white);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  padding: 16px 24px;
  box-shadow: var(--h-shadow);
  margin-bottom: 10px;
}

.hackathon-team-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
}

.badge-icon {
  font-size: 1.3rem;
}

/* ==========================================================================
   Chat Room Styles (Left Column)
   ========================================================================== */
.hackathon-chat-card {
  display: flex;
  flex-direction: column;
  height: 600px;
}

.chat-status-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--h-success);
  background-color: #E6FDF5;
  padding: 4px 10px;
  border-radius: 9999px;
  gap: 6px;
}

.chat-status-indicator .dot {
  width: 6px;
  height: 6px;
  background-color: var(--h-success);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.5; }
}

.hackathon-chat-box {
  flex-grow: 1;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  background-color: var(--h-bg-offset);
  padding: 20px;
  overflow-y: auto;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Chat bubble styling */
.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  align-self: flex-start;
}

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

.chat-message-meta {
  font-size: 0.75rem;
  color: var(--h-text-light);
  margin-bottom: 4px;
  padding: 0 4px;
}

.chat-message.chat-self .chat-message-meta {
  text-align: right;
}

.chat-message-bubble {
  background-color: var(--h-bg-white);
  border: 1px solid var(--h-border);
  padding: 10px 16px;
  border-radius: 0 16px 16px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  word-break: break-all;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.4;
}

.chat-message.chat-self .chat-message-bubble {
  background-color: var(--h-primary);
  border-color: var(--h-primary);
  color: var(--h-bg-white);
  border-radius: 16px 0 16px 16px;
  box-shadow: 0 4px 10px rgba(0, 98, 230, 0.15);
}

.chat-author-name {
  font-weight: 700;
  color: var(--h-text-muted);
}

.chat-message.chat-self .chat-author-name {
  color: var(--h-primary);
}

/* Chat Form inputs */
.hackathon-chat-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-form-row {
  display: flex;
  gap: 10px;
}

#hackathon-chat-author {
  padding: 10px 14px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  font-size: 0.9rem;
  width: 200px;
  background-color: var(--h-bg-offset);
  transition: var(--h-transition);
}

#hackathon-chat-author:focus {
  outline: none;
  border-color: var(--h-primary);
  background-color: var(--h-bg-white);
}

#hackathon-chat-message {
  flex-grow: 1;
  padding: 10px 14px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  font-size: 0.9rem;
  resize: none;
  background-color: var(--h-bg-offset);
  transition: var(--h-transition);
  height: 54px;
}

#hackathon-chat-message:focus {
  outline: none;
  border-color: var(--h-primary);
  background-color: var(--h-bg-white);
}

#chat-send-btn {
  padding: 0 24px;
}

/* ==========================================================================
   File Hub Styles (Right Column)
   ========================================================================== */
.hackathon-files-card {
  display: flex;
  flex-direction: column;
  max-height: 600px;
}

.hackathon-upload-area {
  border: 2px dashed var(--h-border);
  background-color: var(--h-bg-offset);
  border-radius: var(--h-radius);
  padding: 24px 20px;
  text-align: center;
  transition: var(--h-transition);
  cursor: pointer;
  margin-bottom: 20px;
}

.hackathon-upload-area.dragover {
  border-color: var(--h-primary);
  background-color: var(--h-primary-light);
}

.upload-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.upload-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.upload-subtitle {
  color: var(--h-text-light);
  font-size: 0.8rem;
  margin-bottom: 12px;
}

/* Progress bar */
.hackathon-upload-progress {
  background-color: var(--h-bg-offset);
  padding: 12px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  margin-bottom: 20px;
}

.progress-bar-container {
  background-color: var(--h-border);
  height: 6px;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  background-color: var(--h-primary);
  height: 100%;
  transition: width 0.1s linear;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Uploaded Files list grid */
.hackathon-files-list-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

.hackathon-files-list-container h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--h-text-muted);
}

.hackathon-files-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  padding: 12px;
  background-color: var(--h-bg-offset);
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--h-bg-white);
  border: 1px solid var(--h-border);
  padding: 10px 14px;
  border-radius: var(--h-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.01);
  transition: var(--h-transition);
}

.file-row:hover {
  border-color: var(--h-primary);
  box-shadow: 0 4px 12px rgba(0, 98, 230, 0.04);
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 70%;
}

.file-name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--h-text-main);
}

.file-meta {
  font-size: 0.75rem;
  color: var(--h-text-light);
}

.file-uploader {
  font-weight: 600;
  color: var(--h-text-muted);
}

.file-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--h-bg-offset);
  color: var(--h-primary);
  border: 1px solid var(--h-border);
  transition: var(--h-transition);
  font-size: 0.9rem;
}

.file-action-btn:hover {
  background-color: var(--h-primary);
  border-color: var(--h-primary);
  color: var(--h-bg-white);
}

/* Empty State */
.files-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--h-text-light);
  font-size: 0.85rem;
}

/* ==========================================================================
   Lobby View Layout & Directory
   ========================================================================== */
.hackathon-lobby-container {
  display: flex;
  flex-direction: column;
}

.hackathon-lobby-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
}

.hackathon-teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.team-card {
  background-color: var(--h-bg-offset);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  padding: 16px;
  transition: var(--h-transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

.team-card:hover {
  border-color: var(--h-primary);
  background-color: var(--h-bg-white);
  transform: translateY(-2px);
  box-shadow: var(--h-shadow-lg);
}

.team-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.team-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--h-text-main);
}

.team-icon {
  font-size: 1.2rem;
}

.team-card-action {
  flex-shrink: 0;
}

.team-inline-login-form {
  border-top: 1px dashed var(--h-border);
  padding-top: 12px;
}

.team-inline-login-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.team-inline-key-input {
  flex-grow: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--h-border);
  border-radius: 6px;
  background-color: var(--h-bg-white) !important;
  color: var(--h-text-main) !important;
}

.team-inline-key-input:focus {
  outline: none;
  border-color: var(--h-primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 98, 230, 0.1) !important;
}

.team-inline-error {
  margin-top: 6px;
  color: #b32d2e;
  font-size: 0.75rem;
  display: block;
}

/* ==========================================================================
   Responsive Layout
   ========================================================================== */
@media (max-width: 768px) {
  .hackathon-workspace-grid,
  .hackathon-lobby-grid {
    grid-template-columns: 1fr;
  }
  
  .hackathon-lobby-grid > .hackathon-card {
    grid-column: auto !important;
  }
  
  .hackathon-chat-card,
  .hackathon-files-card {
    height: 500px;
  }
  
  #hackathon-chat-author {
    width: 120px;
  }
}
