:root {
  --bg-color: #242433;
  --panel-color: #2a2a3b;
  --text-color: #f5f5f5;
  --accent-color: #4fc3f7;
  --button-bg: #3b3b4f;
  --button-hover: #5c5c72;
  --input-bg: #2c2c3c;
  --blur-bg: rgba(0, 0, 0, 0.7);
  --transition-speed: 0.3s;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-top: 4.5rem;
}

/* ----- Navbar ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4.25rem;
  background-color: var(--panel-color);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  padding: 0 1rem;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-brand {
  flex-shrink: 0;
}

#logo {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  object-fit: cover;
}

.navbar-title {
  font-size: 1.75rem;
  color: var(--accent-color);
  text-align: center;
  margin: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar-title a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-speed);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.navbar-title a:hover {
  color: var(--text-color);
}

.admin {
  flex-shrink: 0;
}

.admin a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--transition-speed);
  white-space: nowrap;
}
.admin a:hover {
  color: var(--accent-color);
}

#profile {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
}

@media(max-width: 768px) {
  .navbar {
    padding: 0 0.75rem;
    height: 4rem;
  }
  #logo {
    width: 2.5rem;
    height: 2.5rem;
  }
  .navbar-title {
    font-size: 1.25rem;
  }
  #profile {
    width: 2rem;
    height: 2rem;
  }
  .admin-text {
    display: none;
  }
  body {
    padding-top: 4rem;
  }
}

@media(max-width: 480px) {
  .navbar {
    padding: 0 0.5rem;
    height: 3.5rem;
  }
  #logo {
    width: 2rem;
    height: 2rem;
  }
  .navbar-title {
    font-size: 1rem;
  }
  #profile {
    width: 1.75rem;
    height: 1.75rem;
  }
  body {
    padding-top: 3.5rem;
  }
}

@media(max-width: 320px) {
  .navbar-title {
    font-size: 0.9rem;
  }
}

@media(max-width: 768px) {
  body {
    padding-top: 4rem;
  }
}

@media(max-width: 480px) {
  body {
    padding-top: 3.5rem;
  }
}
/* ----- /Navbar ----- */

/* ----- Main Content ----- */
main {
  padding: 2rem;
  margin-left: 0;
  transition: margin-left var(--transition-speed);
  min-height: calc(100vh - 12rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-screen {
  text-align: center;
  padding: 0 0 2rem 0;
}

.welcome-header {
  margin-bottom: 2rem;
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}

.welcome-header h2 {
  color: var(--accent-color);
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.welcome-description {
  margin-bottom: 2.5rem;
  text-align: left;
}

.welcome-description > p {
  font-size: 1.1rem;
  color: var(--text-color);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-align: center;
}

.assessment-info {
  background: rgba(79, 195, 247, 0.05);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--text-color);
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-icon {
  font-size: 1.25rem;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.disclaimer {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
}

.disclaimer p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(245, 245, 245, 0.9);
  line-height: 1.4;
}

.welcome-actions {
  text-align: center;
}

#start-assessment-btn {
  background: linear-gradient(135deg, #6ec2e9, #48a1ca);
  color: white;
  padding: 1.25rem 3rem;
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-speed);
  letter-spacing: 0.75px;
  box-shadow: 0 4px 15px rgba(79, 195, 247, 0.2);
  position: relative;
  overflow: hidden;
}
#start-assessment-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(79, 195, 247, 0.3);
}

#start-assessment-btn:active {
  transform: translateY(-1px);
}

#start-assessment-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}
#start-assessment-btn:hover::before {
  left: 100%;
}

#input-container {
  background-color: var(--panel-color);
  padding: 2rem;
  border-radius: 15px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(79, 195, 247, 0.1);
  width: 100%;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-color);
  margin: 0;
  text-align: left;
}

.input-description {
  font-size: 0.9rem;
  color: rgba(245, 245, 245, 0.7);
  margin: 0;
  line-height: 1.4;
  padding: 0.25rem 0;
}

.user-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--button-bg);
  border-radius: 8px;
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 1.1rem;
  transition: all var(--transition-speed);
  box-sizing: border-box;
  font-family: inherit;
}

.user-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

.user-input::placeholder {
  color: rgba(245, 245, 245, 0.5);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.user-select {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--button-bg);
  border-radius: 8px;
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 1.1rem;
  transition: all var(--transition-speed);
  box-sizing: border-box;
  font-family: inherit;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 3rem;
}

.user-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

.user-select option {
  background-color: var(--input-bg);
  color: var(--text-color);
  padding: 0.5rem;
}

.user-select option:first-child {
  color: rgba(245, 245, 245, 0.5);
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-speed);
  letter-spacing: 0.75px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
  padding: 1rem 2rem;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #6ec2e9, #48a1ca);
  color: white;
  font-size: 1.1rem;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(79, 195, 247, 0.3);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--button-bg);
  color: var(--text-color);
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
}

.btn-secondary:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

#next-btn {
  background: linear-gradient(135deg, #6ec2e9, #48a1ca);
  color: white;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  width: 100%;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-speed);
  letter-spacing: 0.75px;
  box-sizing: border-box;
}

#next-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(79, 195, 247, 0.3);
}

#next-btn:active {
  transform: translateY(-1px);
}

#next-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#back-btn {
  background: var(--button-bg);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  margin-top: 0.5rem;
  width: 100%;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-speed);
  letter-spacing: 0.75px;
  box-sizing: border-box;
}

#back-btn:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

.step-indicator {
  margin-bottom: 1.5rem;
  text-align: center;
}

.step-indicator span {
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: block;
  font-size: 1rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--button-bg);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.75rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), #29b6f6);
  transition: width 0.5s ease;
  border-radius: 3px;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.error-message {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  border-left: 4px solid #f44336;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2);
}

.error-message.show {
  opacity: 1;
  transform: translateY(0);
  animation: shake 0.5s ease-in-out;
}

#loader {
  text-align: center;
  padding: 3rem;
  background-color: var(--panel-color);
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(79, 195, 247, 0.1);
}

#loader p {
  font-size: 1.3rem;
  color: var(--accent-color);
  margin: 0;
  animation: pulse 2s infinite;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(79, 195, 247, 0.3);
  border-left: 4px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

#result {
  background: linear-gradient(135deg, var(--panel-color), #2e2e42);
  padding: 2.5rem;
  border-radius: 15px;
  margin-top: 2rem;
  text-align: center;
  animation: slideInUp var(--transition-speed) ease-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(79, 195, 247, 0.2);
}

#result h2 {
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  font-weight: 700;
}

#prediction-text {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
}

.result-content {
  text-align: center;
}

.result-header {
  margin-bottom: 0.5rem;
}

.risk-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 10px;
}

.risk-indicator.high-risk {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.risk-indicator.low-risk {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.risk-icon {
  font-size: 2rem;
}

.risk-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.risk-text strong {
  font-size: 1.5rem;
}

.confidence {
  color: var(--accent-color);
  font-size: 0.9rem;
}

.result-details p {
  color: rgba(245, 245, 245, 0.8);
  font-size: 0.9rem;
  line-height: 1.4;
}

.restart-btn {
  background: var(--button-bg);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-speed);
  margin-top: 1rem;
}

.restart-btn:hover {
  background: var(--button-hover);
  transform: scale(1.05);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
@keyframes slideInUp {
  from { 
    opacity: 0; 
    transform: translateY(30px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0);
  }
}

@media(min-width: 1200px) {
  main {
    padding: 3rem;
  }
  #input-container {
    padding: 3rem;
  }
}

@media(max-width: 768px) {
  main {
    padding: 1.5rem;
    margin-left: 2.5rem !important;
  }
  body.sidebar-open main {
    margin-left: calc(250px + 1rem) !important;
    margin-right: 1rem;
    max-width: none;
    padding: 1rem;
  }
  .welcome-screen {
    padding: 0 0 1.5rem 0;
  }
  .welcome-icon {
    font-size: 3rem;
  }
  .welcome-header h2 {
    font-size: 1.75rem;
  }
  .welcome-description > p {
    font-size: 1rem;
  }
  .assessment-info {
    padding: 1.25rem;
  }
  .info-item {
    font-size: 0.95rem;
  }
  #start-assessment-btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
  }
  #input-container {
    padding: 1.5rem;
  }
  .input-section {
    gap: 0.75rem;
  }
  .step-indicator span {
    font-size: 0.9rem;
  }
  .input-label {
    font-size: 1.1rem;
  }
  .user-input {
    padding: 0.875rem;
    font-size: 1rem;
  }
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  .btn-primary {
    font-size: 1rem;
  }
  #result {
    padding: 2rem;
  }
  #result h2 {
    font-size: 1.75rem;
  }
  #prediction-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  main {
    padding: 1rem;
    min-height: calc(100vh - 4rem);
  }
  body.sidebar-open main {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: none !important;
  }
  .welcome-screen {
    padding: 0 0 1rem 0;
  }
  .welcome-icon {
    font-size: 2.5rem;
  }
  .welcome-header h2 {
    font-size: 1.5rem;
  }
  .welcome-description > p {
    font-size: 0.95rem;
  }
  .assessment-info {
    padding: 1rem;
  }
  .info-item {
    font-size: 0.9rem;
    gap: 0.5rem;
  }
  .disclaimer p {
    font-size: 0.85rem;
  }
  #start-assessment-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: 100%;
  }
  #input-container {
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    min-height: 280px;
  }
  .input-section {
    gap: 0.5rem;
  }
  .step-indicator span {
    font-size: 0.85rem;
  }
  .input-label {
    font-size: 1rem;
  }
  .input-description {
    font-size: 0.85rem;
  }
  .user-input {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
  .user-select {
    padding: 0.75rem;
    font-size: 0.95rem;
    padding-right: 2.5rem;
    background-size: 0.8rem;
  }
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
  .progress-bar {
    height: 4px;
  }
  #result {
    padding: 1.5rem;
    border-radius: 12px;
  }
  #result h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  #prediction-text {
    font-size: 1rem;
  }
  #loader {
    padding: 2rem;
  }
  #loader p {
    font-size: 1.1rem;
  }
  .risk-indicator {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .risk-text strong {
    font-size: 1.25rem;
  }
}

@media (max-width: 320px) {
  main {
    padding: 0.75rem;
    min-height: calc(100vh - 3.5rem);
  }
  #input-container {
    padding: 1rem;
    min-height: 260px;
  }
  .welcome-header h2 {
    font-size: 0 0 1.25rem;
  }
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    text-align: left;
  }
  .info-icon {
    align-self: flex-start;
  }
  .input-label {
    font-size: 0.95rem;
  }
  .input-description {
    font-size: 0.8rem;
  }
  #result {
    padding: 1.25rem;
  }
  #result h2 {
    font-size: 1.25rem;
  }
  .step-indicator span {
    font-size: 0.8rem;
  }
}

.hidden {
  display: none !important;
}
/* ----- /Main Content ----- */