/*
 * Glass Nomenclature Tool - Glass Website Theme Integration
 * 
 * This CSS file applies Glass website theme elements to the glassnomenclature.com tool
 * for seamless visual integration when embedded via iframe.
 * 
 * Note: Background colors are intentionally not modified to maintain iframe transparency.
 */

/* ============================================
   FONT IMPORT - Lato from Google Fonts
   ============================================ */

/* Import Lato font with all needed weights */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap');

/* ============================================
   ROOT VARIABLES - Glass Theme Colors & Fonts
   ============================================ */

:root {
  /* Primary Colors */
  --glass-primary: #0073B9;
  --glass-primary-hover: #00436d;
  --glass-secondary: #324958;
  
  /* Neutral Colors */
  --glass-white: #ffffff;
  --glass-black: #000000;
  --glass-black-light: #212529;
  --glass-gray-light: #CCCCCC;
  --glass-gray: #EEEEEF;
  --glass-gray-global: #F5F5F5;
  --glass-gray-darker: #777777;
  
  /* Blue Variations */
  --glass-blue-light: #21B6f2;
  --glass-blue-lighter: #E6EFF6;
  --glass-blue-medium: #2A5FAA;
  --glass-blue: #0d66A3;
  --glass-blue-cta: #0065A5;
  --glass-blue-grey-dark: #1A313F;
  --glass-blue-grey-light: #334a5a;
  --glass-blue-link: #CBE5F2;
  
  /* Typography */
  --glass-font-family: 'Lato', Roboto, "Helvetica Neue", Arial, sans-serif;
  --glass-font-size-base: 1.25rem;
  --glass-font-size-sm: 1.09rem;
  --glass-font-size-lg: 1.56rem;
  --glass-line-height: 1.5;
  
  /* Font Weights */
  --glass-font-weight-regular: 400;
  --glass-font-weight-medium: 500;
  --glass-font-weight-semibold: 600;
  --glass-font-weight-bold: 700;
  --glass-font-weight-black: 900;
  
  /* Spacing */
  --glass-space-sm: 5px;
  --glass-space-md: 10px;
  --glass-space-lg: 20px;
  --glass-space-xl: 40px;
  
  /* Borders & Radius */
  --glass-border-radius: 0.25rem;
  --glass-border-color: #cdcdcd;
  --glass-border-width: 1px;
}

/* ============================================
   BASE TYPOGRAPHY
   ============================================ */

body,
html {
  font-family: var(--glass-font-family);
  font-size: var(--glass-font-size-base);
  font-weight: var(--glass-font-weight-regular);
  line-height: var(--glass-line-height);
  color: var(--glass-black-light);
}

/* Headings */
h1, .h1 {
  font-size: 2.75rem;
  font-weight: var(--glass-font-weight-bold);
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--glass-black-light);
}

h2, .h2 {
  font-size: 2rem;
  font-weight: var(--glass-font-weight-bold);
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--glass-black-light);
}

h3, .h3 {
  font-size: 1.75rem;
  font-weight: var(--glass-font-weight-bold);
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--glass-black-light);
}

h4, .h4 {
  font-size: 1.625rem;
  font-weight: var(--glass-font-weight-bold);
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--glass-black-light);
}

h5, .h5 {
  font-size: 1.5rem;
  font-weight: var(--glass-font-weight-bold);
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--glass-black-light);
}

h6, .h6 {
  font-size: 1.25rem;
  font-weight: var(--glass-font-weight-bold);
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--glass-black-light);
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* ============================================
   LINKS
   ============================================ */

a {
  color: var(--glass-primary);
  text-decoration: underline;
  transition: all 0.3s ease-in;
}

a:hover,
a:focus {
  color: var(--glass-primary-hover);
  text-decoration: none;
}

/* ============================================
   BUTTONS
   ============================================ */

button,
.btn,
.button,
input[type="submit"],
input[type="button"],
input[type="reset"],
[role="button"] {
  display: inline-block;
  font-family: var(--glass-font-family);
  font-weight: var(--glass-font-weight-semibold);
  font-size: 1em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: var(--glass-border-width) solid transparent;
  padding: var(--glass-space-md) 15px;
  margin-bottom: 1rem;
  border-radius: var(--glass-border-radius);
  transition: all 0.3s ease-in;
  cursor: pointer;
  overflow: hidden;
}

/* Primary Button */
.btn-primary,
button.primary,
input[type="submit"] {
  background-color: var(--glass-primary);
  color: var(--glass-white);
  border-color: var(--glass-primary);
}

.btn-primary:hover,
.btn-primary:focus,
button.primary:hover,
button.primary:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
  background-color: var(--glass-primary-hover);
  border-color: var(--glass-primary-hover);
  color: var(--glass-white);
  text-decoration: none;
}

/* Secondary Button */
.btn-secondary,
button.secondary {
  color: var(--glass-blue);
  background-color: transparent;
  border-color: var(--glass-blue-cta);
}

.btn-secondary:hover,
.btn-secondary:focus,
button.secondary:hover,
button.secondary:focus {
  border-color: transparent;
  color: var(--glass-white);
  background-color: var(--glass-blue-light);
  text-decoration: none;
}

/* Outline Button */
.btn-outline,
.btn-outline-primary {
  color: var(--glass-primary);
  background-color: var(--glass-white);
  border-color: var(--glass-primary);
}

.btn-outline:hover,
.btn-outline:focus,
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: var(--glass-white);
  background-color: var(--glass-primary);
  border-color: var(--glass-primary);
  text-decoration: none;
}

/* Link-style Button */
a.btn,
a.button {
  text-decoration: none;
}

a.btn:hover,
a.button:hover {
  text-decoration: none;
}

/* Disabled State */
button:disabled,
.btn:disabled,
.button:disabled,
input[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

/* Labels */
label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: var(--glass-font-weight-bold);
  color: var(--glass-black-light);
}

/* Inputs, Textareas, Selects */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
textarea,
select {
  display: block;
  width: 100%;
  font-family: var(--glass-font-family);
  font-size: 1rem;
  font-weight: var(--glass-font-weight-regular);
  line-height: var(--glass-line-height);
  color: var(--glass-black-light);
  border: var(--glass-border-width) solid var(--glass-border-color);
  border-radius: var(--glass-border-radius);
  padding: 0.5rem 0.75rem;
  min-height: 50px;
  box-shadow: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  border-color: var(--glass-primary);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 115, 185, 0.25);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

select {
  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='%23212529' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 12px;
  padding-right: 2.5rem;
}

/* Required Fields */
label.required::after,
label[required]::after {
  content: "*";
  color: #dc3545;
  display: inline-block;
  margin-left: 2px;
}

/* Form Groups */
.form-group,
.form-item,
.field {
  margin-bottom: 1.5rem;
  position: relative;
}

/* Checkboxes & Radio Buttons */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  margin-right: 0.5rem;
}

.form-check,
.checkbox,
.radio {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-check label,
.checkbox label,
.radio label {
  font-weight: var(--glass-font-weight-regular);
  margin-bottom: 0;
  cursor: pointer;
}

/* Help Text */
.form-text,
.help-text,
.description {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--glass-gray-darker);
}

/* Error States */
.error,
.is-invalid,
.has-error {
  border-color: #dc3545 !important;
}

.error-message,
.invalid-feedback {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th,
td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: var(--glass-border-width) solid var(--glass-border-color);
  text-align: left;
}

th {
  font-weight: var(--glass-font-weight-bold);
  color: var(--glass-black-light);
  background-color: var(--glass-gray-global);
}

thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--glass-border-color);
}

tbody + tbody {
  border-top: 2px solid var(--glass-border-color);
}

tr:hover {
  background-color: var(--glass-gray-global);
}

/* Striped Tables */
.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Bordered Tables */
.table-bordered th,
.table-bordered td {
  border: var(--glass-border-width) solid var(--glass-border-color);
}

/* ============================================
   CARDS
   ============================================ */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: var(--glass-border-width) solid var(--glass-border-color);
  border-radius: var(--glass-border-radius);
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  border-bottom: var(--glass-border-width) solid var(--glass-border-color);
  font-weight: var(--glass-font-weight-bold);
}

.card-body {
  flex: 1 1 auto;
  padding: 1.25rem;
}

.card-title {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: var(--glass-font-weight-bold);
  color: var(--glass-gray-darker);
}

.card-title a {
  color: var(--glass-gray-darker);
  text-decoration: none;
}

.card-title a:hover,
.card-title a:focus {
  color: var(--glass-primary);
  text-decoration: none;
}

.card-footer {
  padding: 0.75rem 1.25rem;
  border-top: var(--glass-border-width) solid var(--glass-border-color);
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */

.alert,
.message {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: var(--glass-border-width) solid transparent;
  border-radius: var(--glass-border-radius);
}

.alert-info,
.message-info {
  color: #004085;
  background-color: #D0E7F5;
  border-color: #b8daff;
}

.alert-success,
.message-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-warning,
.message-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeaa7;
}

.alert-error,
.alert-danger,
.message-error {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

/* ============================================
   CODE & PRE
   ============================================ */

code,
pre {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
}

code {
  padding: 0.2rem 0.4rem;
  color: #e83e8c;
  background-color: var(--glass-gray-global);
  border-radius: var(--glass-border-radius);
}

pre {
  display: block;
  padding: 1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  overflow: auto;
  color: var(--glass-black-light);
  background-color: var(--glass-gray-global);
  border: var(--glass-border-width) solid var(--glass-border-color);
  border-radius: var(--glass-border-radius);
}

pre code {
  padding: 0;
  font-size: inherit;
  color: inherit;
  background-color: transparent;
  border-radius: 0;
}

/* ============================================
   LISTS
   ============================================ */

ul,
ol {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2rem;
}

ul ul,
ol ol,
ul ol,
ol ul {
  margin-bottom: 0;
}

dt {
  font-weight: var(--glass-font-weight-bold);
}

dd {
  margin-bottom: 0.5rem;
  margin-left: 0;
}

/* Custom Checkmark List */
ul.checkmarks,
.checklist {
  list-style: none;
  padding-left: 0;
}

ul.checkmarks li::before,
.checklist li::before {
  content: '✓';
  color: var(--glass-primary);
  font-weight: var(--glass-font-weight-bold);
  padding-right: 0.5rem;
}

/* ============================================
   NAVIGATION
   ============================================ */

nav {
  font-family: var(--glass-font-family);
}

nav ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--glass-primary);
  text-decoration: none;
}

nav a:hover,
nav a:focus {
  color: var(--glass-primary-hover);
  text-decoration: underline;
}

/* ============================================
   UTILITIES
   ============================================ */

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Transform */
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

/* Font Weight */
.font-weight-light { font-weight: var(--glass-font-weight-regular); }
.font-weight-normal { font-weight: var(--glass-font-weight-regular); }
.font-weight-bold { font-weight: var(--glass-font-weight-bold); }
.font-weight-bolder { font-weight: var(--glass-font-weight-black); }

/* Text Colors */
.text-primary { color: var(--glass-primary) !important; }
.text-secondary { color: var(--glass-secondary) !important; }
.text-muted { color: var(--glass-gray-darker) !important; }
.text-white { color: var(--glass-white) !important; }
.text-dark { color: var(--glass-black-light) !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }

/* Spacing Utilities */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mr-0 { margin-right: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.ml-0 { margin-left: 0 !important; }

.m-1 { margin: 0.25rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.ml-1 { margin-left: 0.25rem !important; }

.m-2 { margin: 0.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.ml-2 { margin-left: 0.5rem !important; }

.m-3 { margin: 1rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.ml-3 { margin-left: 1rem !important; }

.m-4 { margin: 1.5rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.ml-4 { margin-left: 1.5rem !important; }

.m-5 { margin: 3rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mr-5 { margin-right: 3rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.ml-5 { margin-left: 3rem !important; }

.p-0 { padding: 0 !important; }
.pt-0 { padding-top: 0 !important; }
.pr-0 { padding-right: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }
.pl-0 { padding-left: 0 !important; }

.p-1 { padding: 0.25rem !important; }
.pt-1 { padding-top: 0.25rem !important; }
.pr-1 { padding-right: 0.25rem !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.pl-1 { padding-left: 0.25rem !important; }

.p-2 { padding: 0.5rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pl-2 { padding-left: 0.5rem !important; }

.p-3 { padding: 1rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pl-3 { padding-left: 1rem !important; }

.p-4 { padding: 1.5rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pl-4 { padding-left: 1.5rem !important; }

.p-5 { padding: 3rem !important; }
.pt-5 { padding-top: 3rem !important; }
.pr-5 { padding-right: 3rem !important; }
.pb-5 { padding-bottom: 3rem !important; }
.pl-5 { padding-left: 3rem !important; }

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  body, html {
    font-size: 1.25rem;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  h1, .h1 { font-size: 3rem; }
  h2, .h2 { font-size: 2.25rem; }
  h3, .h3 { font-size: 1.9rem; }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  h1, .h1 { font-size: 3.5rem; }
  h2, .h2 { font-size: 2.5rem; }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  /* Additional styles for extra large screens */
}

/* ============================================
   SPECIFIC GLASS NOMENCLATURE TOOL ELEMENTS
   ============================================ */

/* Decoder/Builder Container */
.decoder-container,
.builder-container,
.tool-container {
  font-family: var(--glass-font-family);
  padding: 1.5rem;
}

/* Result Display */
.result-display,
.output-display,
.nomenclature-result {
  padding: 1.25rem;
  margin: 1rem 0;
  border: var(--glass-border-width) solid var(--glass-border-color);
  border-radius: var(--glass-border-radius);
}

.result-display pre,
.output-display pre,
.nomenclature-result pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Component Sections */
.component-section,
.glass-component {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-left: 4px solid var(--glass-primary);
}

/* Coating Descriptions */
.coating-description,
.description-text {
  font-style: italic;
  color: var(--glass-gray-darker);
  margin-top: 0.5rem;
}

/* Interlayer & Spacer Info */
.interlayer-info,
.spacer-info {
  background-color: var(--glass-gray-global);
  padding: 0.75rem;
  border-radius: var(--glass-border-radius);
  margin: 0.5rem 0;
}

/* Error Display */
.error-container,
.nomenclature-error {
  padding: 1rem;
  margin: 1rem 0;
  border-left: 4px solid #dc3545;
  background-color: #f8d7da;
  color: #721c24;
}

/* Success Display */
.success-container,
.nomenclature-success {
  padding: 1rem;
  margin: 1rem 0;
  border-left: 4px solid #28a745;
  background-color: #d4edda;
  color: #155724;
}

/* Schema Selector */
.schema-selector,
.version-selector {
  margin-bottom: 1.5rem;
}

.schema-selector select,
.version-selector select {
  max-width: 200px;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  border-bottom: 2px solid var(--glass-border-color);
  margin-bottom: 1.5rem;
  padding-left: 0;
  list-style: none;
}

.nav-tabs li {
  margin-right: 0.5rem;
}

.nav-tabs a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--glass-gray-darker);
  text-decoration: none;
  border: var(--glass-border-width) solid transparent;
  border-bottom: none;
  border-radius: var(--glass-border-radius) var(--glass-border-radius) 0 0;
  transition: all 0.3s ease;
}

.nav-tabs a:hover {
  background-color: var(--glass-gray-global);
  color: var(--glass-primary);
}

.nav-tabs a.active {
  color: var(--glass-primary);
  background-color: transparent;
  border-color: var(--glass-border-color) var(--glass-border-color) transparent;
  font-weight: var(--glass-font-weight-bold);
}

/* API Documentation */
.api-endpoint {
  font-family: monospace;
  background-color: var(--glass-gray-global);
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--glass-primary);
  margin: 1rem 0;
  overflow-x: auto;
}

.api-method {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: var(--glass-primary);
  color: var(--glass-white);
  font-weight: var(--glass-font-weight-bold);
  border-radius: var(--glass-border-radius);
  margin-right: 0.5rem;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus Visible */
*:focus-visible {
  outline: 2px solid var(--glass-primary);
  outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to Content Link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--glass-primary);
  color: var(--glass-white);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* ============================================
   SMOOTH SCROLLING & TRANSITIONS
   ============================================ */

html {
  scroll-behavior: smooth;
}

* {
  transition-property: background-color, border-color, color;
  transition-duration: 0.3s;
  transition-timing-function: ease-in;
}

/* Disable transitions on page load */
.preload * {
  transition: none !important;
}

