/* Add at the very top of style.css */
@font-face {
    font-family: 'Work Sans';
    src: url('/wp-content/themes/hello-blocks-child/fonts/WorkSans-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Rubik';
    src: url('/wp-content/themes/hello-blocks-child/fonts/Rubik-SemiBold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
  --primary-dark-spruce: #234326;
  --secondary-honeydew: #F1FFF5;
  --beige: #F5F5DC;
  --grey: #D3D3D3;
  --slate-grey: #6B7280;
  --onyx-headings: #141414;
  --carbon-body-text: #1F1F1F;
  --indigo-cta: #6A0DAD;
  --carbon-overlay: #262626;
}

/* Apply fonts */
body, .ss-calc-wrapper, input, select, button {
    font-family: 'Work Sans', Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6, 
.ss-calc-wrapper h2, 
.ss-calc-wrapper h3 {
    font-family: 'Rubik', Arial, sans-serif;
    font-weight: bold;
}

.ss-calc-wrapper { 
  font-family: 'Work Sans', Arial, sans-serif; 
  padding: 1.25rem;        /* 20px */
  background: var(--beige); 
  color: var(--carbon-body-text);
}

table { 
  width: 100%; 
  border-collapse: collapse; 
  margin-top: 0.625rem;    /* 10px */
}

th, td { 
  border: 1px solid var(--grey); 
  padding: 0.375rem;       /* 6px */
  text-align: center;
}

th { 
  background: var(--secondary-honeydew); 
  color: var(--onyx-headings);
  font-weight: bold;
}

input[type="text"], 
input[type="number"], 
input[type="date"], 
select { 
  padding: 0.25rem;        /* 4px */
  border: 1px solid var(--grey);
  box-sizing: border-box;
  color: var(--carbon-body-text);
  background: white;
}

.calculate-btn { 
  background-color: var(--primary-dark-spruce);
  color: white;
  border: 1px solid var(--primary-dark-spruce);
  padding: 0.375rem 0.75rem;   /* 6px 12px */
  border-radius: 0.25rem;      /* 4px */
  cursor: pointer;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;               /* 6px */
}

.clear-btn {
  background-color: var(--slate-grey);
  color: white;
  border: 1px solid var(--slate-grey);
  padding: 0.375rem 0.75rem;   /* 6px 12px */
  border-radius: 0.25rem;      /* 4px */
  cursor: pointer;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;               /* 6px */
}

.clear-btn:hover {
  background-color: #5a6268;
}

.amort-btn {
  background-color: var(--onyx-headings);
  color: white;
  border: 1px solid var(--carbon-overlay);
  padding: 0.375rem 0.75rem;   /* 6px 12px */
  border-radius: 0.25rem;      /* 4px */
  cursor: pointer;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;               /* 6px */
}

.add-payment-btn {
  background-color: var(--primary-dark-spruce);
  color: white;
  border: 1px solid var(--primary-dark-spruce);
  padding: 0.375rem 0.75rem;   /* 6px 12px */
  border-radius: 0.25rem;      /* 4px */
  cursor: pointer;
  font-weight: bold;
  margin-top: 0.8125rem;       /* 13px */
}

.add-payment-btn::before {
  content: "+";
  color: white;
  margin-right: 0.25rem;       /* 4px */
  font-weight: bold;
}

.recalc { 
  background-color: #AF4B08;
  color: white; 
  font-weight: bold; 
  font-size: 1rem;            /* 16px */
  display: none;
  padding: 0.375rem 0.75rem;  /* 6px 12px */
  border: 2px solid #fff59d;
  border-radius: 0.25rem;     /* 4px */
  margin-left: 0.25rem;       /* 4px */
  cursor: pointer;
  transition: all 0.3s;
  align-items: center;
  gap: 0.375rem;              /* 6px */
}

.recalc:hover {
  background-color: #e68900;
  transform: scale(1.05);
}

.top-controls-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;               /* 12px */
  flex-wrap: nowrap;
  width: 100%;
  margin-bottom: 0.9375rem;   /* 15px */
}

.left-controls-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;                /* 8px */
  flex-shrink: 0;
  width: 400px;               /* Fixed width */
}

.chevrons-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem;               /* 4px */
  flex: 1;
  min-width: 0;
}

.rates-section:first-of-type {
  width: 215px;               /* Fixed width */
}

.rates-section:nth-of-type(2) {
  width: 280px;               /* Fixed width */
}

.rates-section:last-of-type {
  width: 215px;               /* Fixed width */
}

.valuation-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;               /* 20px */
  margin: 0.9375rem 0;        /* 15px */
  width: 100%;
}

.valuation-item {
  display: flex;
  align-items: center;
  gap: 0.3125rem;             /* 5px */
}

.chevron-trigger,
.chevron {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: var(--indigo-cta);
  font-weight: bold;
  padding: 0.25rem 0.5rem;    /* 4px 8px */
  border-radius: 0.1875rem;   /* 3px */
}

.chevron-trigger:hover,
.chevron:hover {
  background-color: rgba(106, 13, 173, 0.1);
  cursor: pointer;
}

/* Label alignments */
#ratesChevron {
  text-align: left !important;
  width: 100%;
}

#calculationMethodChevron {
  text-align: center !important;
  width: 100%;
}

#howToUseChevron {
  text-align: right !important;
  width: 100%;
}

/* Dropdown panels */
.chevron-panel {
  position: absolute;
  top: 100%;
  margin-top: 0.3125rem;      /* 5px */
  padding: 0.5rem;            /* 8px */
  background-color: var(--beige);
  color: var(--carbon-body-text);
  z-index: 100;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border: 1px solid var(--grey);
  border-radius: 0.25rem;     /* 4px */
  text-align: left;
}

/* Panel positioning */
.chevron-item--rates .chevron-panel {
  left: 0;
  right: auto;
}

.chevron-item--method .chevron-panel {
  left: 50%;
  transform: translateX(-50%);
  right: auto;
}

.chevron-item--howto .chevron-panel {
  right: 0;
  left: auto;
}

/* Rates panel - no wrapping */
.chevron-panel--rates {
  white-space: nowrap;
  min-width: auto;
  width: fit-content;
}

/* Other panels - normal wrapping */
.chevron-panel--method,
.chevron-panel--howto {
  white-space: normal;
  min-width: 240px;           /* Fixed width */
}

/* Backward compatibility for existing structure */
.rates-section {
  display: block;
  position: relative;
  width: 100%;
}

.chevron-content {
  display: none;
  position: absolute;
  top: 100%;
  margin-top: 0.3125rem;      /* 5px */
  padding: 0.5rem;            /* 8px */
  background-color: var(--beige);
  color: var(--carbon-body-text);
  z-index: 100;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border: 1px solid var(--grey);
  border-radius: 0.25rem;     /* 4px */
  text-align: left;
}

.chevron-content div {
  margin: 0.1875rem 0;        /* 3px */
  font-size: 0.875rem;        /* 14px */
}

#ratesContent div {
  white-space: nowrap;
}

.chevron-content p {
  margin: 0.3125rem 0;        /* 5px */
  font-size: 0.9rem;          /* 14.4px */
  white-space: normal;
  max-width: 400px;           /* Fixed width */
}

.chevron-content strong {
  display: inline;
  margin-bottom: 0;
}

.cola-input { 
  width: 50px;                /* Fixed width */
  background: var(--grey) !important;
  color: var(--carbon-body-text);
  border: 1px solid #B0B0B0 !important;
  pointer-events: none;
  text-align: center;
  -moz-appearance: textfield;
} 

.cola-input.editable {
  background: white !important; 
  color: var(--carbon-body-text);
  pointer-events: auto;
  border: 1px solid var(--grey) !important;
}

.cola-input::-webkit-outer-spin-button,
.cola-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.periods-input { 
  width: 60px;                /* Fixed width */
  background: var(--grey); 
  border: 1px solid #B0B0B0; 
  pointer-events: none; 
  color: var(--carbon-body-text);
}

.periods-input:not([disabled]) {
  background: white;
  pointer-events: auto;
  border: 1px solid var(--grey);
}

.num-payments-input { 
  width: 56px;                /* Fixed width */
  border: 1px solid var(--grey); 
}

.amount-input { 
  width: 150px;               /* Fixed width */
  border: 1px solid var(--grey); 
}

.purchase-price { 
  width: 150px;               /* Fixed width */
  font-size: 1rem;            /* 16px */
  border: 1px solid var(--grey); 
}

.aggregate-field {
  width: 150px;               /* Fixed width */
  font-size: 1rem;            /* 16px */
  border: 1px solid var(--grey);
  background-color: #f0f0f0;
  color: var(--carbon-body-text);
  cursor: text;
}

#nomRate { 
  width: 105px;               /* Fixed width */
  font-size: 1rem;            /* 16px */
  border: 1px solid var(--grey); 
}

#valDate { 
  border: 1px solid var(--grey); 
  font-size: 1rem;            /* 16px */
}

.flash {
  background-color: #fff59d !important;
  transition: background-color 1s ease;
}

.aggregate-flash {
  background-color: #fff59d !important;
  transition: background-color 1s ease;
}

.delete-btn { 
  cursor: pointer; 
  color: #999999;
  font-size: 1.1rem;          /* 17.6px */
  background: none; 
  border: none; 
  padding: 0.125rem 0.375rem; /* 2px 6px */
}

.delete-btn:hover {
  background-color: rgba(153, 153, 153, 0.1);
  border-radius: 0.1875rem;   /* 3px */
}

.colaPopup {
  background: #fff59d;
  border: 1px solid var(--slate-grey);
  padding: 0.375rem;          /* 6px */
  font-size: 0.9rem;          /* 14.4px */
  margin-top: 0.3125rem;      /* 5px */
  display: flex;
  align-items: center;
  gap: 0.25rem;               /* 4px */
  border-radius: 0.1875rem;   /* 3px */
}

.reset-cola-btn {
  font-size: 0.8rem;          /* 12.8px */
  padding: 0.25rem 0.5rem;    /* 4px 8px */
  margin-left: 0.25rem;       /* 4px */
  background-color: var(--slate-grey);
  color: white;
  border: none;
  border-radius: 0.125rem;    /* 2px */
  cursor: pointer;
}

.reset-cola-btn:hover {
  background-color: #5a6268;
}

.amortization-container {
  margin-top: 1.25rem;        /* 20px */
  border-top: 2px solid var(--grey);
  padding-top: 0.625rem;      /* 10px */
  display: none;
}

.amortization-container h3 {
  margin-bottom: 0.625rem;    /* 10px */
  color: var(--onyx-headings);
}

.amortization-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.3125rem;      /* 5px */
  font-size: 0.9rem;          /* 14.4px */
}

.amortization-table th, 
.amortization-table td {
  border: 1px solid var(--grey);
  padding: 0.25rem;           /* 4px */
  text-align: right;
  color: var(--carbon-body-text);
}

.amortization-table th {
  background: var(--secondary-honeydew);
  text-align: center;
  color: var(--onyx-headings);
  font-weight: bold;
}

.amortization-table .date-col {
  text-align: center;
  min-width: 90px;            /* Fixed width */
}

.amortization-table .line-num-col {
  text-align: center;
  min-width: 30px;            /* Fixed width */
  font-weight: bold;
}

.year-band {
  background-color: rgba(245, 245, 220, 0.3);
}

.year-separator {
  height: 10px;               /* Fixed height */
  background-color: var(--grey);
}

.year-total-row {
  background-color: var(--secondary-honeydew) !important;
  font-weight: bold;
  border-top: 2px solid var(--slate-grey) !important;
  border-bottom: 2px solid var(--slate-grey) !important;
  border-left: 2px solid var(--slate-grey) !important;
  border-right: 2px solid var(--slate-grey) !important;
}

.required-highlight {
    background-color: #fff59d !important;
    border: 2px solid #ff9800 !important;
}

select {
    padding: 0.25rem 0.5rem;  /* 4px 8px */
    border: 1px solid var(--grey);
    border-radius: 0.1875rem; /* 3px */
    background-color: white;
    min-width: 120px;         /* Fixed width */
    color: var(--carbon-body-text);
}

.date-error {
    border: 2px solid #e74c3c !important;
    background-color: #ffe6e6 !important;
}

.error-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.error-modal-content {
    background-color: white;
    padding: 1.5625rem;       /* 25px */
    border-radius: 0.5rem;    /* 8px */
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 28.125rem;     /* 450px */
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-1.25rem); } /* 20px */
    to { opacity: 1; transform: translateY(0); }
}

.error-modal h3 {
    margin-top: 0;
    color: var(--primary-dark-spruce);
    padding-bottom: 0.9375rem; /* 15px */
    border-bottom: 2px solid var(--primary-dark-spruce);
    font-size: 1.25rem;        /* 20px */
    margin-bottom: 0.9375rem;  /* 15px */
}

.error-modal p {
    font-size: 1rem;           /* 16px */
    line-height: 1.5;
    margin-bottom: 1.5625rem;  /* 25px */
    color: var(--carbon-overlay);
}

.error-modal-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.25rem;       /* 20px */
}

.error-modal-ok {
    padding: 0.625rem 1.25rem; /* 10px 20px */
    border: none;
    border-radius: 0.25rem;    /* 4px */
    font-size: 0.875rem;       /* 14px */
    font-weight: 600;
    cursor: pointer;
    min-width: 5rem;           /* 80px */
    transition: all 0.2s;
    background-color: var(--primary-dark-spruce);
    color: white;
}

.error-modal-ok:hover {
    background-color: #1a351d;
}

.powered-by {
    text-align: center;
    margin-top: 0.9375rem;     /* 15px */
    font-size: 0.85rem;        /* 13.6px */
    color: var(--carbon-body-text);
}

.powered-by a {
    color: var(--indigo-cta);
    text-decoration: none;
    font-weight: 500;
}

.powered-by a:hover {
    text-decoration: underline;
}

.icon-svg {
  width: 1rem;                /* 16px */
  height: 1rem;               /* 16px */
  vertical-align: middle;
  display: inline-block;
}

/* Diagonal stripes for N/A cells */
.diagonal-stripe {
  background: repeating-linear-gradient(
    45deg,
    var(--secondary-honeydew),
    var(--secondary-honeydew) 8px,
    #d8e8d8 8px,
    #d8e8d8 16px
  ) !important;
}

/* Remove first column separator for YEARS TOTAL rows */
tr.year-total-row td:first-child {
  border-right: none !important;
}
tr.year-total-row td:nth-child(2) {
  border-left: none !important;
}

/* WordPress plugin overrides */
.ss-calc-wrapper {
    text-align: left !important;
    max-width: none !important;
    margin: 0 !important;
}
.ss-calc-wrapper .powered-by a {
    color: #4f46e5 !important;
}

/* ========================================================================== */
/* MOBILE RESPONSIVE */
/* ========================================================================== */
@media screen and (max-width: 768px) {
  h2 {
    font-size: 1.3rem;        /* 20.8px */
  }
  
  h3 {
    font-size: 1.1rem;        /* 17.6px */
    margin-top: 1.5625rem;    /* 25px */
  }
  
  .top-controls-row {
    flex-wrap: wrap;
    gap: 0.375rem;            /* 6px */
  }
  
  .left-controls-group {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .left-controls-group > * {
    flex: 1 1 auto;
  }
  
  .purchase-price,
  #nomRate,
  #valDate,
  .aggregate-field {
    width: 100% !important;
  }
  
/* Mobile panels - stack vertically */
#ratesContent,
#calculationMethodContent,
#howToUseContent {
  position: static;
  width: 100%;
  transform: none;
  margin-top: 0.3125rem;      /* 5px */
  left: auto;
  right: auto;
}

/* Mobile label alignments - all left on mobile */
#ratesChevron,
#calculationMethodChevron,
#howToUseChevron {
  text-align: left !important;
}

  #cashFlowTable {
    margin-top: 1.5625rem;    /* 25px */
  }
  
  #cashFlowTable thead {
    display: none;
  }
  
  #cashFlowTable,
  #cashFlowTable tbody,
  #cashFlowTable tr {
    display: block;
    width: 100%;
  }
  
  #cashFlowTable tr {
    margin-bottom: 0.9375rem; /* 15px */
    border: 2px solid var(--grey);
    border-radius: 0.5rem;    /* 8px */
    padding: 0.75rem;         /* 12px */
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  #cashFlowTable td {
    display: block;
    width: 100%;
    border: none;
    padding: 0.5rem 0;       /* 8px */
    text-align: left !important;
  }
  
  #cashFlowTable td * {
    text-align: left !important;
  }
  
  #cashFlowTable td:first-child {
    font-weight: bold;
    font-size: 1.1rem;        /* 17.6px */
    color: var(--primary-dark-spruce);
    border-bottom: 1px solid var(--grey);
    margin-bottom: 0.5rem;    /* 8px */
  }
  
  #cashFlowTable td:first-child::before {
    content: "Payment #";
  }
  
  #cashFlowTable td:last-child {
    text-align: center !important;
    margin-top: 0.75rem;      /* 12px */
    padding-top: 0.75rem;
    border-top: 1px solid var(--grey);
  }
  
  #cashFlowTable td:not(:first-child):not(:last-child)::before {
    content: attr(data-label);
    font-weight: bold;
    display: inline-block;
    width: 8.75rem;           /* 140px */
    color: var(--onyx-headings);
  }
  
  #cashFlowTable td:nth-child(2)::before { content: "Type: "; }
  #cashFlowTable td:nth-child(3)::before { content: "Start Date: "; }
  #cashFlowTable td:nth-child(4)::before { content: "Amount: "; }
  #cashFlowTable td:nth-child(5)::before { content: "# Payments: "; }
  #cashFlowTable td:nth-child(6)::before { content: "COLA %: "; }
  #cashFlowTable td:nth-child(7)::before { content: "# of Periods: "; }
  #cashFlowTable td:nth-child(8)::before { content: "End Date: "; }
  
  .add-payment-btn {
    width: 100%;
    margin-top: 1.25rem;      /* 20px */
  }
  
  .amortization-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .amortization-table {
    min-width: 37.5rem;       /* 600px */
  }
}

/* ========================================================================== */
/* PRINT STYLES */
/* ========================================================================== */
@media print {
  .top-controls-row,
  .add-payment-btn,
  .powered-by,
  button {
    display: none !important;
  }
  
  #cashFlowTable th:last-child,
  #cashFlowTable td:last-child {
    display: none !important;
  }
  
  #cashFlowTable td,
  #cashFlowTable th {
    vertical-align: middle !important;
  }
  
  #cashFlowTable input,
  #cashFlowTable select {
    vertical-align: middle !important;
    margin: 0 !important;
  }
  
  #amortizationContainer {
    display: block !important;
  }
  
  .amortization-table {
    width: 100%;
    page-break-inside: avoid;
  }
  
  .amortization-table thead {
    background-color: var(--secondary-honeydew) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .valuation-row {
    background-color: var(--secondary-honeydew) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .year-total-row {
    background-color: var(--secondary-honeydew) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .diagonal-stripe {
    background: repeating-linear-gradient(
      45deg,
      var(--grey),
      var(--grey) 2px,
      transparent 2px,
      transparent 6px
    ) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  h2, h3 {
    page-break-after: avoid;
  }
  
  body {
    background: white;
  }
}

/* ========================================================================== */
/* END OF FILE */
/* ========================================================================== */