/* Global Styling */
:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --bg-app: #f8fafc;
  --bg-sidebar: #0f172a;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #ffffff;
  --border-light: #e2e8f0;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Skill colors */
  --color-reading: #ef4444;
  --color-listening: #06b6d4;
  --color-writing: #f59e0b;
  --color-speaking: #10b981;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: #1e293b;
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar Layout */
.sidebar {
  width: 320px;
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #1e293b;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-header h4 {
  color: #fff;
  font-weight: 700;
}

.sidebar-controls {
  padding: 15px;
  border-bottom: 1px solid #1e293b;
}

.sidebar-controls .input-group-text,
.sidebar-controls input,
.sidebar-controls select,
.sidebar-tabs select {
  background-color: #1e293b;
  border: 1px solid #334155;
  color: #fff;
}

.sidebar-controls input::placeholder {
  color: #64748b;
}

.sidebar-controls input:focus,
.sidebar-controls select:focus,
.sidebar-tabs select:focus {
  background-color: #1e293b;
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: none;
}

/* Attempts List */
.attempts-list-container {
  flex-grow: 1;
  overflow-y: auto;
}

.attempts-list-container::-webkit-scrollbar {
  width: 5px;
}
.attempts-list-container::-webkit-scrollbar-thumb {
  background-color: #334155;
  border-radius: 4px;
}

.attempt-item {
  background-color: transparent !important;
  border: none;
  border-bottom: 1px solid #1e293b !important;
  color: var(--text-sidebar) !important;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.attempt-item:hover {
  background-color: #1e293b !important;
  color: #fff !important;
}

.attempt-item.active {
  background-color: #1e293b !important;
  color: #fff !important;
}

.attempt-item.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--primary-color);
}

.attempt-item-title {
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attempt-item-exam {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attempt-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

/* Main Content Layout */
.main-content {
  flex-grow: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-content {
  height: 100%;
  overflow: hidden;
}

.welcome-card {
  max-width: 600px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.icon-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Info Bar */
.info-bar {
  padding: 24px 30px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.workspace-body {
  overflow: hidden;
  height: calc(100vh - 110px);
}

/* Custom Navigation Tabs */
.custom-tabs {
  border-bottom: 1px solid var(--border-light);
  background-color: #fff;
  padding-top: 10px;
}

.custom-tabs .nav-link {
  border: none;
  color: #64748b;
  font-weight: 500;
  padding: 12px 20px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.custom-tabs .nav-link:hover {
  color: #334155;
  border-bottom-color: #cbd5e1;
}

.custom-tabs .nav-link.active {
  color: #0f172a;
  font-weight: 600;
}

.custom-tabs #reading-tab.active { border-bottom-color: var(--color-reading); }
.custom-tabs #listening-tab.active { border-bottom-color: var(--color-listening); }
.custom-tabs #writing-tab.active { border-bottom-color: var(--color-writing); }
.custom-tabs #speaking-tab.active { border-bottom-color: var(--color-speaking); }

/* Score Cards */
.card-score {
  border-radius: 12px;
  border-width: 1px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-score:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.score-input {
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  border-radius: 8px;
}

.card-overall-score {
  background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

/* Question Layouts */
.passage-content-box {
  background-color: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.task-card {
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  margin-bottom: 25px;
  border: 1px solid var(--border-light);
}

.task-header {
  padding: 15px 20px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  border-top-left-radius: 11px;
  border-top-right-radius: 11px;
}

.student-response-box {
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  font-size: 1.05rem;
  line-height: 1.6;
  white-space: pre-wrap;
  min-height: 120px;
  font-family: inherit;
}

/* Speak custom layout */
.speaking-audio-player {
  background-color: #f1f5f9;
  border-radius: 30px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
  max-width: 100%;
}

.speaking-audio-player audio {
  flex-grow: 1;
  height: 40px;
}

.transcript-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  font-weight: 600;
}

.transcript-box {
  background-color: #f8fafc;
  border-left: 3px solid #cbd5e1;
  padding: 8px 15px;
  font-style: italic;
  font-size: 0.9rem;
  color: #475569;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-pane {
  animation: fadeIn 0.3s ease-out forwards;
}

.max-w-500 {
  max-width: 500px;
}
.tracking-wider {
  letter-spacing: 0.08em;
}
.fs-7 {
  font-size: 0.8rem;
}
.reset-score-btn {
  text-decoration: none;
  font-size: 0.8rem;
}
.reset-score-btn:hover {
  opacity: 0.8;
}

/* Sidebar Exam Selector Styling */
.sidebar-tabs {
  background-color: #0b1120;
  border-color: #1e293b !important;
}

.active-tab-header {
  background-color: #0b1120;
  border-color: #1e293b !important;
}

.active-tab-header #active-tab-title {
  color: #94a3b8 !important;
}

/* Login Overlay Styling */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 420px;
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1), 0 8px 15px -6px rgba(0, 0, 0, 0.05) !important;
  overflow: hidden;
}

.login-logo-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(79, 70, 229, 0.08) !important;
  color: var(--primary-color) !important;
}

.login-card label {
  margin-bottom: 6px;
  color: #475569 !important;
}

.login-card h3 {
  color: #0f172a !important;
}

.login-card p.text-muted {
  color: #64748b !important;
}

.login-card .input-group-text {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #64748b;
}

.login-card input {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  transition: all 0.2s ease;
}

.login-card input:focus {
  background-color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
  color: #0f172a;
}

.login-card .btn-primary {
  background-color: var(--primary-color);
  border: none;
  transition: all 0.2s ease;
}

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

.login-card .btn-primary:active {
  transform: translateY(0);
}

#btn-logout {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
