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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  height: 100vh;
  overflow: hidden;
}

#landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #ffffff;
}

.landing-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: translateY(-25%);
  padding: 40px;
}

#landing h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.02em;
}

#landing p {
  font-size: 1.1rem;
  color: #64748b;
}

.join-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.join-box input {
  padding: 12px 18px;
  font-size: 1.1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #1e293b;
  text-transform: uppercase;
  width: 180px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.join-box input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.join-box button {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  background: #3b82f6;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.join-box button:hover {
  background: #2563eb;
}

.join-box button:active {
  transform: scale(0.97);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f8fafc;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

header #roomCode {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2563eb;
  font-family: monospace;
  background: #eff6ff;
  padding: 4px 12px;
  border-radius: 8px;
}

header #timer {
  font-size: 0.95rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

header button {
  padding: 8px 18px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

header button:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.tabs {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #334155;
  background: #f8fafc;
}

.tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #ffffff;
}

.tab-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  background: #f1f5f9;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid #e2e8f0;
}

.sidebar .btn-add {
  padding: 10px;
  background: #3b82f6;
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: auto;
  transition: background 0.2s;
}

.sidebar .btn-add:hover {
  background: #2563eb;
}

#noteList, #folderTree {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-item, .folder-item {
  padding: 10px 12px;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid transparent;
  transition: all 0.15s;
  font-size: 0.9rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.note-item:hover, .folder-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.note-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
  font-weight: 500;
}

.editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 12px;
  overflow: hidden;
}

.editor-header {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.editor-header input {
  flex: 1;
  padding: 10px 14px;
  font-size: 1rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s;
}

.editor-header input:focus {
  border-color: #3b82f6;
}

.editor-header button {
  padding: 10px 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.editor-header button:hover {
  background: #e2e8f0;
}

#noteEditor {
  flex: 1;
  padding: 16px;
  font-size: 1rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  color: #1e293b;
  resize: none;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s;
}

#noteEditor:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.editor-actions button {
  padding: 10px 18px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.editor-actions button:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.file-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

#dropZone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  min-height: 300px;
  padding: 40px;
  text-align: center;
  transition: all 0.2s;
  background: #ffffff;
  color: #64748b;
}

#dropZone.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #2563eb;
}

#dropZone input[type="file"] {
  margin-top: 8px;
}

#fileList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.file-card {
  background: #ffffff;
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  word-break: break-all;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.file-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .sidebar { width: 200px; padding: 12px; }
  #noteEditor { font-size: 16px; }
  .landing-box { padding: 20px; }
  #landing h1 { font-size: 2.5rem; }
}
