/**
 * App shell styles (teacher + student panels)
 */

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

:root {
  --primary: #06b6d4;
  --primary-dark: #0891b2;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --spacing: 1rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
}

/* Panels */
.panel {
  display: none;
}

.panel.active {
  display: flex;
}

.panel.hidden {
  display: none;
}

/* Teacher Panel */
#teacher-panel.active {
  display: grid;
  grid-template-columns: 250px 1fr;
  height: 100vh;
  gap: 0;
}

.teacher-sidebar {
  background-color: var(--gray-900);
  color: white;
  padding: 2rem var(--spacing);
  overflow-y: auto;
}

.teacher-sidebar h2 {
  margin-bottom: 2rem;
  font-size: 1.5rem;
}

.teacher-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--gray-300);
  padding: 0.75rem 1rem;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-btn:hover,
.nav-btn.active {
  background-color: var(--primary);
  color: white;
}

.teacher-main {
  padding: 2rem;
  overflow-y: auto;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tab-content h3 {
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  color: var(--gray-900);
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
}

textarea,
input[type="text"],
input[type="email"],
input[type="url"] {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* File Input */
.file-input-label {
  display: inline-block;
  padding: 1rem;
  border: 2px dashed var(--gray-300);
  border-radius: 4px;
  background-color: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-weight: 600;
}

.file-input-label:hover {
  border-color: var(--primary);
  background-color: #f0f9fb;
}

.file-input-hidden {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--primary);
  color: white;
}

.btn:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--gray-300);
  color: var(--gray-900);
}

.btn-secondary:hover {
  background-color: var(--gray-400);
}

/* Status Messages */
.status {
  padding: 1rem;
  border-radius: 4px;
  font-weight: 600;
  margin-top: 1rem;
  display: none;
}

.status.show {
  display: block;
}

.status.success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.status.error {
  background-color: #fee2e2;
  color: #91210e;
  border: 1px solid #fca5a5;
}

.status.info {
  background-color: #e0f2fe;
  color: #0c4a6e;
  border: 1px solid #7dd3fc;
}

/* Student Panel */
#student-panel.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.student-header {
  background-color: var(--primary);
  color: white;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-header h2 {
  margin: 0;
}

.student-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  gap: 0;
  overflow: hidden;
}

.document-viewer {
  background-color: white;
  border-right: 1px solid var(--gray-200);
  overflow-y: auto;
  padding: 2rem;
}

.document-content {
  line-height: 1.8;
  color: var(--gray-800);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  background-color: white;
  overflow: hidden;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 6px;
  max-width: 85%;
}

.chat-message.student {
  background-color: var(--primary);
  color: white;
  align-self: flex-end;
  text-align: right;
}

.chat-message.assistant {
  background-color: var(--gray-100);
  color: var(--gray-900);
  align-self: flex-start;
}

.chat-form {
  border-top: 1px solid var(--gray-200);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
}

.chat-form textarea {
  flex: 1;
  min-height: 60px;
}

.chat-form .btn {
  align-self: flex-end;
  padding: 0.75rem 1.5rem;
}

/* Assignments List */
.list {
  display: grid;
  gap: 1rem;
}

.list-item {
  background: white;
  padding: 1.5rem;
  border-radius: 6px;
  border-left: 4px solid var(--primary);
}

.list-item h4 {
  margin-bottom: 0.5rem;
}

.list-item p {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.list-item-actions {
  display: flex;
  gap: 0.5rem;
}

.list-item-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
  #teacher-panel {
    grid-template-columns: 1fr;
  }

  .teacher-sidebar {
    display: flex;
    gap: 1rem;
    height: auto;
  }

  .teacher-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .student-container {
    grid-template-columns: 1fr;
  }

  .document-viewer {
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    max-height: 50%;
  }
}

@media (max-width: 640px) {
  .student-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .chat-message {
    max-width: 95%;
  }

  .document-viewer {
    padding: 1rem;
  }

  .chat-panel {
    padding: 1rem;
  }
}
