/**
 * ZUBI BAKES - BRAND STYLES
 * Brand Guidelines v1.0
 *
 * Professional bakery production calculator web app
 * Target: Professional bakery staff and master bakers
 */

/* ===================================
   CSS CUSTOM PROPERTIES (Variables)
   =================================== */

:root {
  /* Primary Brand Colors */
  --zubi-teal: #0099A8;
  --zubi-black: #000000;
  --zubi-text: #323232;
  --zubi-bg: #F5F5F5;
  --zubi-white: #FFFFFF;

  /* Supporting Colors (Status/Alerts) */
  --zubi-success: #00A854;
  --zubi-warning: #FF9500;
  --zubi-danger: #FF3B30;
  --zubi-info: #0099A8;

  /* UI Element Colors */
  --border-light: #E0E0E0;
  --border-card: #E8E8E8;
  --inactive-gray: #999999;

  /* Typography */
  --font-family: 'Inter', 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;

  /* Font Sizes */
  --text-display: 64px;
  --text-h1: 32px;
  --text-h2: 24px;
  --text-h3: 20px;
  --text-h4: 18px;
  --text-body: 16px;
  --text-small: 14px;

  /* Line Heights */
  --line-height-heading: 1.2;
  --line-height-body: 1.5;
  --line-height-small: 1.4;

  /* Border Radius */
  --radius-button: 8px;
  --radius-card: 12px;
  --radius-input: 8px;
  --radius-modal: 16px;

  /* Shadows */
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-button-hover: 0 4px 12px rgba(0, 153, 168, 0.3);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Transitions */
  --transition-fast: 200ms ease-in-out;
  --transition-normal: 300ms ease-in-out;

  /* Touch Targets */
  --touch-target-min: 44px;
  --touch-target-recommended: 48px;
}

/* Mobile font sizes */
@media (max-width: 639px) {
  :root {
    --text-display: 48px;
    --text-h1: 24px;
    --text-h2: 20px;
    --text-h3: 18px;
    --text-h4: 16px;
  }
}

/* ===================================
   GLOBAL BASE STYLES
   =================================== */

body {
  font-family: var(--font-family);
  font-size: var(--text-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  color: var(--zubi-text);
  background-color: var(--zubi-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-heading);
  color: var(--zubi-text);
  margin: 0 0 var(--spacing-md) 0;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

p {
  margin: 0 0 var(--spacing-md) 0;
  line-height: var(--line-height-body);
}

.text-display {
  font-size: var(--text-display);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-heading);
}

.text-small {
  font-size: var(--text-small);
  line-height: var(--line-height-small);
}

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

.btn, button[type="submit"], .button {
  font-family: var(--font-family);
  font-size: var(--text-body);
  font-weight: var(--font-weight-semibold);
  padding: 12px 24px;
  border-radius: var(--radius-button);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  min-height: var(--touch-target-min);
  line-height: 1.5;
}

.btn:focus, button:focus {
  outline: 2px solid var(--zubi-teal);
  outline-offset: 2px;
}

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

.btn-primary:hover, button[type="submit"]:hover {
  opacity: 0.9;
  box-shadow: var(--shadow-button-hover);
}

.btn-primary:active, button[type="submit"]:active {
  opacity: 0.8;
  transform: scale(0.98);
}

/* Secondary Button */
.btn-secondary {
  background-color: var(--zubi-white);
  color: var(--zubi-teal);
  border: 2px solid var(--zubi-teal);
}

.btn-secondary:hover {
  background-color: var(--zubi-teal);
  color: var(--zubi-white);
}

/* Danger Button */
.btn-danger {
  background-color: var(--zubi-danger);
  color: var(--zubi-white);
}

.btn-danger:hover {
  opacity: 0.9;
}

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

.card {
  background-color: var(--zubi-white);
  border-radius: var(--radius-card);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-card);
  margin-bottom: var(--spacing-lg);
}

.card-header {
  background-color: var(--zubi-black);
  color: var(--zubi-white);
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  padding: 12px var(--spacing-md);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  margin: calc(var(--spacing-lg) * -1) calc(var(--spacing-lg) * -1) var(--spacing-md);
}

.card-body {
  padding: var(--spacing-md) 0;
}

.card-footer {
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-light);
  margin-top: var(--spacing-md);
}

/* ===================================
   FORMS & INPUTS
   =================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: var(--font-family);
  font-size: var(--text-body);
  font-weight: var(--font-weight-regular);
  color: var(--zubi-text);
  background-color: var(--zubi-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  width: 100%;
  transition: border-color var(--transition-fast);
  min-height: var(--touch-target-min);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--zubi-teal);
  box-shadow: 0 0 0 3px rgba(0, 153, 168, 0.1);
}

label {
  font-size: var(--text-small);
  font-weight: var(--font-weight-regular);
  color: var(--zubi-text);
  display: block;
  margin-bottom: var(--spacing-xs);
}

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-help {
  font-size: var(--text-small);
  color: var(--inactive-gray);
  margin-top: var(--spacing-xs);
}

/* ===================================
   SECTION HEADERS
   =================================== */

.section-header {
  background-color: var(--zubi-black);
  color: var(--zubi-white);
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  padding: 12px var(--spacing-md);
  border-radius: var(--radius-input);
  margin-bottom: var(--spacing-md);
}

/* ===================================
   NAVIGATION & HEADER
   =================================== */

.top-bar,
.app-header {
  background-color: var(--zubi-black);
  color: var(--zubi-white);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-card);
}

.logo {
  height: 32px;
  width: auto;
}

.nav-bottom {
  background-color: var(--zubi-white);
  border-top: 1px solid var(--border-light);
  padding: var(--spacing-sm) 0;
}

.nav-item {
  color: var(--inactive-gray);
  text-decoration: none;
  transition: color var(--transition-fast);
  padding: var(--spacing-sm);
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item:hover,
.nav-item.active {
  color: var(--zubi-teal);
}

/* ===================================
   STATUS BADGES
   =================================== */

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: var(--text-small);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.badge-success {
  background-color: var(--zubi-success);
  color: var(--zubi-white);
}

.badge-warning {
  background-color: var(--zubi-warning);
  color: var(--zubi-white);
}

.badge-danger {
  background-color: var(--zubi-danger);
  color: var(--zubi-white);
}

.badge-info {
  background-color: var(--zubi-teal);
  color: var(--zubi-white);
}

.badge-ingredient {
  background-color: #E3F2FD;
  color: #1976D2;
}

.badge-component {
  background-color: #F3E5F5;
  color: #7B1FA2;
}

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

.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-input);
  margin-bottom: var(--spacing-md);
  border-left: 4px solid;
}

.alert-success {
  background-color: #E8F5E9;
  border-color: var(--zubi-success);
  color: #2E7D32;
}

.alert-warning {
  background-color: #FFF3E0;
  border-color: var(--zubi-warning);
  color: #E65100;
}

.alert-danger {
  background-color: #FFEBEE;
  border-color: var(--zubi-danger);
  color: #C62828;
}

.alert-info {
  background-color: #E0F7FA;
  border-color: var(--zubi-teal);
  color: #00838F;
}

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

table {
  width: 100%;
  background-color: var(--zubi-white);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

thead {
  background-color: var(--zubi-black);
  color: var(--zubi-white);
}

th {
  padding: 12px var(--spacing-md);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-small);
}

td {
  padding: 12px var(--spacing-md);
  border-top: 1px solid var(--border-light);
}

tr:hover {
  background-color: var(--zubi-bg);
}

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

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

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

@media (min-width: 640px) {
  .top-bar,
  .app-header {
    height: 64px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    margin: 0 auto;
  }
}

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

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--zubi-teal);
  color: var(--zubi-white);
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--zubi-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
