:root {
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary: #5d55fa;
    --primary-hover: #4f46e5;
    --input-bg: #ffffff;
    --slider-bg: #cbd5e1;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --card-bg: #1e293b;
        --text-main: #f1f5f9;
        --text-muted: #94a3b8;
        --border-color: #334155;
        --input-bg: #0f172a;
        --slider-bg: #475569;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: background-color 0.3s, color 0.3s;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.font-medium {
    font-weight: 500;
}

.app-container {
    width: 100%;
    max-width: 48rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: background-color 0.3s;
}

@media (min-width: 640px) {
    .card {
        padding: 2rem;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.label-small {
    font-size: 0.75rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.input {
    flex-grow: 1;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    color: var(--text-main);
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.3s;
    outline: none;
}

/* Fix datetime-local width issue */
input[type="datetime-local"].input {
    width: 100%;
}

.input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--primary);
}

.button {
    background-color: var(--primary);
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    outline: none;
    font-size: 1rem;
}

.button:hover {
    background-color: var(--primary-hover);
}

.button:focus {
    box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--primary);
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

.output-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
}

@media (min-width: 640px) {
    .output-section {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
}

.output-rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}

.output-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem;
    align-items: start;
}

@media (min-width: 640px) {
    .output-row {
        grid-template-columns: 180px 1fr;
        align-items: center;
    }
}

.output-value {
    font-size: 0.9375rem;
    line-height: 1.25;
    word-break: break-all;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .toggle-group {
        justify-self: end;
    }
}

.bottom-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: end;
}

@media (min-width: 640px) {
    .bottom-inputs {
        grid-template-columns: 1fr 120px;
    }
}

.select-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    cursor: pointer;
}

.bottom-output {
    align-items: start;
    min-height: 28px;
}

@media (min-width: 640px) {
    .bottom-output {
        align-items: center;
    }
}


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

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--slider-bg);
  transition: .4s;
  border-radius: 24px;
}

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

input:checked + .slider {
  background-color: var(--primary);
}

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