:root {
  --light-orange: #fea301;
  --dark-orange: #f54f11;
  --black: #1a1a1a;
  --white: #ffffff;
  --gray-light: #f8f8f8;
  --gray-medium: #e5e5e5;
  --gray-dark: #666666;
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, var(--white) 0%, var(--gray-light) 100%);
  color: var(--black);
  line-height: 1.5;
}

#container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.ms-welcome__header {
  background: var(--black);
  padding: 28px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ms-welcome__header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 100%, rgba(254, 163, 1, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.logo-badge {
  display: inline-block;
  position: relative;
  z-index: 1;
}

.ms-logo {
  max-width: 90px;
  max-height: 90px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(254, 163, 1, 0.4));
}

.ms-welcome__powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.ms-welcome__powered-text {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ms-welcome__powered-link {
  color: var(--light-orange);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ms-welcome__powered-link:hover {
  color: var(--white);
}

/* Auth Section */
.ms-welcome__auth {
  background: var(--white);
  padding: 16px 20px;
  border-bottom: 2px solid var(--light-orange);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#auth-status {
  display: flex;
  align-items: center;
  justify-content: center;
}

#user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

#user-name {
  font-weight: 600;
  color: var(--black);
}

#login-prompt {
  text-align: center;
  width: 100%;
  padding: 20px 0;
}

#login-prompt p {
  margin: 0 0 16px 0;
  color: var(--black);
  font-size: 18px;
  font-weight: 600;
}

#login-button {
  padding: 14px 32px;
  font-size: 15px;
}

/* Buttons */
.ms-Button {
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none;
}

.ms-Button--primary,
#login-button,
#logout-button {
  background: linear-gradient(135deg, var(--dark-orange) 0%, var(--light-orange) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(254, 163, 1, 0.3);
}

.ms-Button--primary:hover,
#login-button:hover,
#logout-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 163, 1, 0.4);
}

#insert-llm-setup {
  background: var(--white);
  color: var(--dark-orange);
  border: 2px solid var(--light-orange);
  width: 100%;
  margin-top: 8px;
}

#insert-llm-setup:hover {
  background: linear-gradient(135deg, var(--dark-orange) 0%, var(--light-orange) 100%);
  color: var(--white);
  border-color: transparent;
}

/* Main Content */
.ms-welcome__main {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Cards */
.ms-welcome__features {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-left: 4px solid var(--light-orange);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ms-welcome__features:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.ms-welcome__features h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ms-welcome__features h2::before {
  content: '';
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--dark-orange) 0%, var(--light-orange) 100%);
  border-radius: 50%;
}

.ms-welcome__features p {
  margin: 0;
  color: var(--gray-dark);
  font-size: 13px;
}

/* Code Blocks */
.ms-welcome__features code {
  display: block;
  background: var(--black);
  color: var(--light-orange);
  padding: 10px 14px;
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 11px;
  margin: 4px 0;
  overflow-x: auto;
}

/* Models Tag */
.models-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--dark-orange) 0%, var(--light-orange) 100%);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 12px;
}

/* Settings Form */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
}

.settings-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-medium);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.settings-select:hover {
  border-color: var(--light-orange);
}

.settings-select:focus {
  outline: none;
  border-color: var(--light-orange);
  box-shadow: 0 0 0 3px rgba(254, 163, 1, 0.15);
}

.settings-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-medium);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--white);
  color: var(--black);
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-textarea:hover {
  border-color: var(--light-orange);
}

.settings-textarea:focus {
  outline: none;
  border-color: var(--light-orange);
  box-shadow: 0 0 0 3px rgba(254, 163, 1, 0.15);
}

.settings-textarea::placeholder {
  color: var(--gray-dark);
  font-style: italic;
}

/* Toggle Switch */
.settings-field--toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-medium);
  transition: all 0.3s ease;
  border-radius: 24px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--white);
  transition: all 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--dark-orange) 0%, var(--light-orange) 100%);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(254, 163, 1, 0.15);
}

.toggle-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-dark);
  min-width: 24px;
}

.toggle-label.active {
  color: var(--dark-orange);
  font-weight: 600;
}

/* Quota Display */
.quota-display {
  margin-bottom: 12px;
}

.quota-bar {
  height: 8px;
  background: var(--gray-medium);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--light-orange) 0%, var(--dark-orange) 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.quota-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.quota-info {
  font-size: 13px;
  color: var(--black);
  font-weight: 600;
}

.quota-reset-info {
  font-size: 11px;
  color: var(--gray-dark);
  margin-top: 4px;
}

.quota-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ms-Button--small {
  padding: 6px 12px;
  font-size: 11px;
  background: var(--gray-light);
  color: var(--gray-dark);
  border: 1px solid var(--gray-medium);
}

.ms-Button--small:hover {
  background: var(--gray-medium);
  color: var(--black);
}

.ms-Button--danger {
  background: var(--white);
  color: #dc2626;
  border: 1px solid #fecaca;
}

.ms-Button--danger:hover {
  background: #dc2626;
  color: var(--white);
  border-color: #dc2626;
}

/* Reset Dialog */
.reset-dialog {
  margin-top: 12px;
  padding: 12px;
  background: var(--gray-light);
  border-radius: 8px;
  border: 1px solid var(--gray-medium);
}

.reset-dialog-content p {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: var(--black);
}

.reset-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-medium);
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 8px;
}

.reset-input:focus {
  outline: none;
  border-color: var(--light-orange);
}

.reset-dialog-actions {
  display: flex;
  gap: 8px;
}

.reset-message {
  font-size: 11px;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
}

.reset-message.success {
  color: #16a34a;
}

.reset-message.error {
  color: #dc2626;
}

/* Footer */
.ms-welcome__footer {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-medium);
}

.ms-welcome__footer p {
  margin: 0;
  font-size: 11px;
  color: var(--gray-dark);
  text-align: center;
}

/* Links */
a {
  color: var(--dark-orange);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--light-orange);
}

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

.ms-welcome__features {
  animation: fadeIn 0.4s ease forwards;
}

.ms-welcome__features:nth-child(1) { animation-delay: 0.1s; }
.ms-welcome__features:nth-child(2) { animation-delay: 0.2s; }
.ms-welcome__features:nth-child(3) { animation-delay: 0.3s; }
.ms-welcome__features:nth-child(4) { animation-delay: 0.4s; }
.ms-welcome__features:nth-child(5) { animation-delay: 0.5s; }

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
  background: var(--light-orange);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--dark-orange);
}
