/* Base Styles */
body {
  background-color: #f5f7fa;
  padding: 0;
  margin: 0;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-family: 'Helvetica Neue', 'Lucida Grande', sans-serif;
  color: #333;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Modern Grid Layout with Fixed Width */
.container {
  width: 100%;
  max-width: 800px;
  margin-right: auto;
  margin-left: auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.column {
  position: relative;
  width: 100%;
  padding: 0 15px;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.center.aligned, .center-aligned {
  text-align: center;
}

.right.aligned {
  text-align: right;
}

.left.aligned {
  text-align: left;
}

.sixteen.wide.column {
  width: 100%;
}

.six.wide.column {
  width: 50%;
}

.four.wide.column {
  width: 33.333%;
}

/* Card Styles */
.form-card {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 25px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

/* Modern Typography */
#title {
  font-family: 'Norwester', 'Helvetica Neue', 'Lucida Grande', sans-serif;
  font-size: 2.8em;
  font-weight: 800;
  margin-bottom: 0.3em;
  margin-top: 10px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
  transition: all 0.3s ease;
  color: #2c3e50;
}

.caption {
  font-family: 'Norwester', 'Helvetica Neue', 'Lucida Grande', sans-serif;
  font-size: 1.3em;
  font-weight: 400;
  margin-top: 3px;
  margin-bottom: 2em;
  opacity: 0.9;
  color: #5a6a7e;
}

.large.header {
  font-size: 1.8em;
  font-weight: 600;
  margin-bottom: 0.8em;
  line-height: 1.3;
  color: #2c3e50;
}

.small.header {
  font-size: 1.1em;
  font-weight: 600;
  margin: 1.5em 0 0.6em;
  line-height: 1.3;
  color: #5a6a7e;
}

/* Label & Field Styles */
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95em;
  color: #5a6a7e;
  text-align: left;
}

.description {
  color: #5a6a7e;
  margin-bottom: 1.5em;
  font-size: 1em;
}

.setting-value {
  background-color: #f5f7fa;
  padding: 10px 14px;
  border-radius: 6px;
  margin-top: 0;
  margin-bottom: 1.2em;
  text-align: left;
  font-family: monospace;
  font-size: 0.9em;
  color: #2c3e50;
}

/* Tab System */
.tabs {
  display: flex;
  border-bottom: 2px solid #e0e4e8;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-button {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95em;
  color: #5a6a7e;
  transition: all 0.2s ease;
  position: relative;
}

.tab-button:hover {
  color: #3498db;
}

.tab-button.active {
  color: #3498db;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #3498db;
}

.tab-content {
  display: none;
  animation: fadeInUp 0.3s ease forwards;
}

.tab-content.active {
  display: block;
}

/* Error & Success Messages */
#error {
  font-family: 'Norwester', 'Helvetica Neue', 'Lucida Grande', sans-serif;
  font-weight: normal;
  color: #ff5252;
  margin-bottom: 1.5em;
  background-color: rgba(255, 82, 82, 0.08);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid #ff5252;
  text-align: left;
  animation: fadeIn 0.3s ease forwards;
}

#success {
  font-family: 'Norwester', 'Helvetica Neue', 'Lucida Grande', sans-serif;
  font-size: 1em;
  font-weight: normal;
  color: #4caf50;
  margin-bottom: 1.5em;
  background-color: rgba(76, 175, 80, 0.08);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid #4caf50;
  text-align: left;
  animation: fadeIn 0.3s ease forwards;
}

#unlink {
  font-family: 'Norwester', 'Helvetica Neue', 'Lucida Grande', sans-serif;
  font-size: 1em;
  font-weight: normal;
  color: #4caf50;
  margin: 0.5em 0 1.5em;
  animation: fadeIn 0.3s ease forwards;
}

/* Link Styles */
a {
  color: #3498db;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

a:hover {
  color: #2980b9;
}

a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: #3498db;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Modern Form Elements */
.form {
  position: relative;
  width: 100%;
}

.field {
  margin-bottom: 1.5em;
  position: relative;
}

select, input[type="text"] {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background-color: #fff;
  color: #24292f;
  font-size: 1em;
  transition: all 0.3s ease;
  box-sizing: border-box;
  appearance: none;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

select {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%235a6a7e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 40px;
}

select:focus, input[type="text"]:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

select option {
  background-color: #fff;
  color: #24292f;
}

input[type="text"]::placeholder {
  color: #a0aec0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 32px;
  display: inline-block;
}

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

.toggle-switch label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e4e8;
  transition: .4s;
  border-radius: 24px;
}

.toggle-switch label:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.toggle-switch input:checked + label {
  background-color: #3498db;
}

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

/* Modern Button Styles */
.button {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background-color: #e0e4e8;
  color: #5a6a7e;
  font-size: 1em;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.button:hover {
  background-color: #d0d7de;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.button:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

.button:disabled {
  cursor: default;
  opacity: 0.5;
  background-color: #e0e4e8;
  color: #a0aec0;
  box-shadow: none;
  transform: none;
}

.positive.button {
  background-color: #3498db;
  color: white;
}

.positive.button:hover {
  background-color: #2980b9;
}

.secondary.button {
  background-color: #3498db;
  color: white;
}

.secondary.button:hover {
  background-color: #2980b9;
}

.danger.button {
  background-color: #e74c3c;
  color: white;
}

.danger.button:hover {
  background-color: #c0392b;
}

/* Icon */
.icon {
  display: inline-block;
  font-style: normal;
  font-weight: normal;
  text-decoration: inherit;
  vertical-align: middle;
  margin-right: 0.5em;
  width: 16px;
  height: 16px;
}

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

.help-text {
  font-size: 0.85em;
  color: #5a6a7e;
  margin-top: 8px;
  text-align: left;
  line-height: 1.4;
}

code {
  background-color: #f5f7fa;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  color: #e74c3c;
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 1;
  }
  20% { transform: scale(25, 25); opacity: 1; }
  100% { opacity: 0; transform: scale(40, 40); }
}

/* Responsive Design */
@media (max-width: 992px) {
  .six.wide.column, .four.wide.column {
    width: 100%;
  }
  
  #title {
    font-size: 2.5em;
  }
  
  .caption {
    font-size: 1.2em;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  #title {
    font-size: 2.2em;
  }
  
  .caption {
    font-size: 1.1em;
  }
  
  .button {
    padding: 10px 20px;
  }
  
  .form-card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  #title {
    font-size: 1.8em;
  }
  
  .caption {
    font-size: 1em;
  }
  
  select, input[type="text"] {
    padding: 10px 12px;
  }
  
  .button {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .tabs {
    flex-wrap: wrap;
  }
  
  .tab-button {
    flex: 1 1 auto;
    padding: 8px 12px;
    font-size: 0.9em;
  }
}