/* My5500 brand-aligned styles - Single Source of Truth */

/* ---------------------------------------------------------------------------
   CSS Variables
   --------------------------------------------------------------------------- */
:root {
  /* Brand Colors */
  --color-space-cadet: #1B264F;
  --color-marian-blue: #274690;
  --color-white-smoke: #F4F4F4;
  --color-non-photo-blue: #8EE3EF;
  --color-emerald: #23CE6B;
  --color-emerald-dark: #16A34A;
  --color-error: #dc3545;

  /* Gray scale */
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-800: #1f2937;

  /* Legacy aliases (for compatibility) */
  --space-cadet: var(--color-space-cadet);
  --marian-blue: var(--color-marian-blue);
  --emerald: var(--color-emerald);
  --emerald-dark: var(--color-emerald-dark);
  --white-smoke: var(--color-white-smoke);
  --error-red: var(--color-error);
  --non-photo-blue: var(--color-non-photo-blue);
}

/* ---------------------------------------------------------------------------
   Base / Reset
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-gray-800);
  background-color: #fafafa;
}

/* ---------------------------------------------------------------------------
   Typography
   --------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5rem 0;
  font-family: 'Mulish', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  color: var(--color-space-cadet);
  line-height: 1.2;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

a {
  color: var(--color-marian-blue);
  text-decoration: none;
}

a:visited {
  color: var(--color-marian-blue);
}

a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   App Layout - unified header (URL-aware nav variants)
   --------------------------------------------------------------------------- */
.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-marian-blue);
  color: white;
  padding: 0.5rem 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-brand {
  font-family: 'Mulish', 'Segoe UI', system-ui, sans-serif;
  font-weight: bold;
  font-size: 1.5rem;
  color: white;
  text-decoration: none;
}

.nav-brand:visited {
  color: white;
}

.nav-brand:hover {
  color: white;
  text-decoration: underline;
}

.app-nav nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-nav nav a {
  color: white;
  text-decoration: none;
}

.app-nav nav a:visited {
  color: white;
}

.app-nav nav a:hover {
  color: white;
  text-decoration: underline;
}

.nav-brand-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-logo img {
  height: 2rem;
  width: auto;
  display: block;
}

.app-main {
  flex: 1;
  padding: 1.5rem 1rem 4rem;
  background-color: var(--color-white-smoke);
}

.app-footer {
  background-color: var(--color-white-smoke);
  color: var(--color-space-cadet);
  padding: 1rem;
  font-size: 0.875rem;
  border-top: 1px solid #e5e7eb;
}

.footer-logo {
  margin-bottom: 0.5rem;
}

.footer-logo img {
  height: 50px;
  width: auto;
  display: block;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-copyright {
  text-align: left;
}

.footer-links {
  text-align: right;
}

.footer-links a {
  color: var(--color-marian-blue);
  text-decoration: none;
  margin: 0 0.25rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Content Area (backward compatibility)
   --------------------------------------------------------------------------- */
.content-area {
  background-color: var(--color-white-smoke);
  padding: 1rem;
}

/* ---------------------------------------------------------------------------
   Form Page - centered narrow content block for login/lookup-style pages
   --------------------------------------------------------------------------- */
.form-page {
  max-width: 480px;
  margin: 2rem auto 0;
}

/* ---------------------------------------------------------------------------
   Logo Banner
   --------------------------------------------------------------------------- */
.logo-banner {
  margin-bottom: 1rem;
}

.logo-banner .style2 {
  margin: 0;
  font-family: 'Mulish', 'Segoe UI', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-space-cadet);
}

/* ---------------------------------------------------------------------------
   Home Landing Page
   --------------------------------------------------------------------------- */
.home-landing {
  display: flex;
  justify-content: center;
  padding: 1rem;
  margin-top: 2rem;
}

.landing-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem 2rem;
  max-width: 600px;
  width: 100%;
}

.landing-card .branding {
  font-family: 'Mulish', 'Segoe UI', system-ui, sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-space-cadet);
  margin: 0 0 0.5rem 0;
}

.landing-card .intro {
  font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  color: var(--color-gray-800);
  margin: 0.5rem 0;
}

.landing-card .section-title {
  font-family: 'Mulish', 'Segoe UI', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-space-cadet);
  margin: 1rem 0 0.5rem 0;
}

.landing-card .continue-link {
  margin: 1rem 0;
}

.landing-card .copyright {
  color: var(--color-gray-400);
  font-style: italic;
  font-size: 0.75rem;
  margin: 1.5rem 0 0 0;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  color: #fff;
  background-color: var(--color-emerald);
  border-color: var(--color-emerald);
}

.btn-primary:hover {
  background-color: var(--color-emerald-dark);
  border-color: var(--color-emerald-dark);
}

.btn-secondary {
  color: #fff;
  background-color: var(--color-space-cadet);
  border-color: var(--color-space-cadet);
}

.btn-secondary:hover {
  background-color: var(--color-marian-blue);
  border-color: var(--color-marian-blue);
}

.btn-danger {
  color: #fff;
  background-color: var(--color-error);
  border-color: var(--color-error);
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

/* ---------------------------------------------------------------------------
   Form Controls
   --------------------------------------------------------------------------- */
label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-gray-800);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}

.form-control:focus {
  border-color: var(--color-non-photo-blue);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(142, 227, 239, 0.25);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
}

.form-check-input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--color-gray-500);
  margin: 0.25rem 0 0 0;
}

/* ---------------------------------------------------------------------------
   Options Logo Section
   --------------------------------------------------------------------------- */
.options-logo-section .logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.options-logo-section .logo-url-cell {
  flex: 1;
  min-width: 200px;
}

.options-logo-section .logo-upload-cell {
  flex: 0 0 auto;
}

.options-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.options-page {
  max-width: 1080px;
  margin: 0 auto;
}

.options-header {
  margin-bottom: 1.5rem;
}

.options-subtitle {
  margin: 0;
  color: var(--color-gray-500);
}

.feedback-banner {
  margin: 0 0 1rem 0;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
}

.feedback-banner-success {
  background: #eefcf4;
  border-color: #b7efcb;
  color: #166534;
}

.feedback-banner-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.options-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
}

.options-card + .options-card {
  margin-top: 1rem;
}

.options-card-primary {
  margin-bottom: 1.25rem;
}

.options-card-header {
  margin-bottom: 1rem;
}

.options-card-header p {
  margin: 0;
}

.options-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.options-field {
  min-width: 0;
}

.options-field-full {
  grid-column: 1 / -1;
}

.options-input-with-actions {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.options-input-with-actions .form-control {
  flex: 1 1 320px;
}

.options-inline-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.options-inline-actions-multi .btn {
  white-space: nowrap;
}

.options-color-field {
  min-width: 0;
}

.options-color-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.options-color-text {
  flex: 1 1 auto;
}

.form-control-color {
  width: 3.5rem;
  min-width: 3.5rem;
  height: 2.75rem;
  padding: 0.25rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  background-color: #fff;
  cursor: pointer;
}

.options-toggle {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid #dbe4f0;
  border-radius: 0.5rem;
  background: #f8fbff;
}

.options-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.options-card-full {
  grid-column: 1 / -1;
}

.options-upload-form {
  margin: 0;
}

.options-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.options-upload-row .form-control {
  flex: 1 1 280px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid #e5e7eb;
}

.table th {
  font-weight: 600;
  background-color: var(--color-white-smoke);
  color: var(--color-space-cadet);
}

.table tbody tr:nth-child(even) {
  background-color: rgba(244, 244, 244, 0.5);
}

/* ---------------------------------------------------------------------------
   Utility Classes - Spacing
   --------------------------------------------------------------------------- */
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.me-2 { margin-inline-end: 0.5rem; }
.p-3 { padding: 1rem; }

/* ---------------------------------------------------------------------------
   Utility Classes - Text Colors
   --------------------------------------------------------------------------- */
.text-success { color: var(--color-emerald); }
.text-danger { color: var(--color-error); }
.text-muted { color: var(--color-gray-500); }

/* ---------------------------------------------------------------------------
   Error Message
   --------------------------------------------------------------------------- */
.error-message {
  color: var(--color-error);
}

/* ---------------------------------------------------------------------------
   Blazor Error UI
   --------------------------------------------------------------------------- */
#blazor-error-ui {
  color-scheme: light only;
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}
