/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding-top: 58px;
  padding-bottom: 60px;
  background: radial-gradient(140% 55% at 48% -15%, #c7ddff 38%, transparent 39%),
              radial-gradient(135% 50% at 52% -10%, #d6e6ff 40%, transparent 41%),
              radial-gradient(130% 45% at 50% -5%, #e6f0ff 42%, transparent 43%),
              radial-gradient(120% 70% at 30% 40%, rgba(147, 197, 253, .45) 46%, transparent 47%),
              radial-gradient(130% 75% at 70% 55%, rgba(96, 165, 250, .35) 48%, transparent 49%),
              radial-gradient(140% 80% at 50% 70%, rgba(59, 130, 246, .18) 52%, transparent 53%),
              radial-gradient(140% 55% at 52% 115%, #c7ddff 38%, transparent 39%),
              radial-gradient(135% 50% at 48% 110%, #d6e6ff 40%, transparent 41%),
              radial-gradient(130% 45% at 50% 105%, #e6f0ff 42%, transparent 43%),
              #f5f8ff;
}

/* Navigation Bar */
.navbar {
  background: linear-gradient(to right, #4a6ca8, #5a7aba);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 58px;
}

.vit-logo {
  font-size: 32px;
  line-height: 1;
}

.vit-text {
  color: #fff;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 2px;
}

.campus-label {
  color: rgba(255, 255, 255, .9);
  font-size: 15px;
  font-weight: 400;
}

/* Container and Cards */
.container {
  max-width: 1200px;
  margin: 40px auto 20px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 20px;
}

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  background: #fff;
  border-bottom: 3px solid #4a6ca8;
  padding: 20px 24px;
}

.card-header h1 {
  color: #1a1a1a;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 24px;
}

/* Progress Levels */
.levels {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.level-item {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  transition: all .3s;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
  margin-right: 8px;
}

.level-item:last-child {
  clip-path: none;
  margin-right: 0;
}

.level-item.active {
  background: #e0eafc;
  color: #3a5a9f;
  border: 2px solid #3a5a9f;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
}

.level-item.active:first-child {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}

.level-item.done {
  background: #dff7e7;
  color: #188a3d;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
}

.level-item.done:first-child {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}

/* Attempts Display */
.attempts {
  background: #fff4db;
  border-left: 4px solid #e89d2f;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-weight: 600;
  color: #7a4a10;
  text-align: center;
  transition: all .2s;
}

.attempts.flash-attention {
  animation: flashAttention .8s ease;
}

@keyframes flashAttention {
  0%, 100% {
    transform: scale(1);
    font-weight: 600;
  }
  50% {
    transform: scale(1.05);
    font-weight: 800;
    color: #5a3508;
  }
}

/* Current Level Display */
.current-level {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  color: #1e293b;
}

/* Action Box */
.action-box {
  background: linear-gradient(135deg, #fef9f1, #fcf3e8);
  border: 2px solid #e8a25c;
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 20px;
  min-height: 280px;
}

/* Form Elements */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #475569;
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: #3a5a9f;
  box-shadow: 0 0 0 3px rgba(58, 90, 159, .1);
}

/* Button */
.btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #7e8fc9, #6a7bb8);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(106, 123, 184, .25);
  margin-top: 8px;
}

.btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #6a7bb8, #5a6ba3);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Memory Grid */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  max-width: 380px;
  margin: 0 auto;
}

.grid-cell {
  aspect-ratio: 1;
  background: #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
}

.grid-cell:hover:not(.clicked) {
  background: #cbd5e1;
  transform: scale(1.05);
}

.grid-cell.flash {
  background: #28c55f;
  border-color: #1a9e4e;
}

.grid-cell.clicked {
  background: #f5be2d;
  border-color: #e8a82f;
}

.grid-cell.wrong {
  background: #ef4444;
  border-color: #dc2626;
}

/* Pattern Display */
.pattern-display {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Sequence Elements */
.sequence-display {
  min-height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.color-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.color-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, .2);
  cursor: pointer;
  transition: all .2s;
}

.color-btn:hover {
  transform: scale(1.15);
}

.color-btn.red {
  background: #ef4444;
}

.color-btn.blue {
  background: #3b82f6;
}

.color-btn.green {
  background: #22c55e;
}

.color-btn.yellow {
  background: #fbbf24;
}

.color-tray {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 80px;
  align-items: center;
  flex-wrap: wrap;
}

/* Instruction Text */
.instruction-text {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Message Box */
.message-box {
  text-align: center;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  transition: all .3s;
  opacity: 0;
  transform: translateY(-10px);
}

.message-box.show {
  opacity: 1;
  transform: translateY(0);
}

.message-box.success {
  background: #d1fae5;
  color: #065f46;
  border: 2px solid #10b981;
}

.message-box.error {
  background: #fee2e2;
  color: #991b1b;
  border: 2px solid #ef4444;
}

/* Hint Box */
.hint-box {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  padding: 16px;
  margin-bottom: 20px;
  transition: all .3s;
}

.hint-box.highlighted {
  background: #e6f3ff;
  border: 2px solid #6ba3d8;
  box-shadow: 0 4px 12px rgba(107, 163, 216, .3);
}

/* Audit Log */
.audit-log {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  padding: 16px;
  height: 550px;
  display: flex;
  flex-direction: column;
}

.audit-log-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
  font-size: 14px;
}

.audit-log-content {
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
  border-radius: 4px;
  padding: 8px;
}

.audit-log ul {
  list-style: none;
}

.audit-log li {
  padding: 6px 8px;
  font-size: 12px;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.audit-log li:last-child {
  border-bottom: none;
}

.audit-log li::before {
  content: "→";
  color: #3a5a9f;
  margin-right: 6px;
  font-weight: bold;
}

/* Banner Messages */
.banner-message {
  text-align: center;
  padding: 32px;
}

.banner-message h2 {
  font-size: 28px;
  margin-bottom: 12px;
}

.banner-message p {
  margin-bottom: 16px;
  font-size: 15px;
  color: #64748b;
}

.banner-denied h2 {
  color: #991b1b;
}

.banner-lockout h2 {
  color: #1e40af;
}

.banner-success h2 {
  color: #166534;
}

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

/* Footer */
.footer {
  background: #4a6ca8;
  color: #fff;
  text-align: center;
  padding: 16px;
  font-size: 13px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

/* Responsive Design */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    margin-bottom: 70px;
  }
  
  .vit-text {
    font-size: 22px;
  }
}
