/* =============================================
   Santerra – Currency Converter (Light Theme)
   ============================================= */

   :root {
    --bg-main: #F4F3EF;       /* Very light grey-beige app background */
    --bg-box-top: #EFECE5;    /* Light sand color for top box */
    --bg-box-bottom: #E8E5DC; /* Slightly darker sand for bottom box */
    --bg-white: #FFFFFF;
    --text-main: #111111;
    --text-muted: #7A7A7A;
    --btn-black: #1A1A1A;
    
    --font: 'Outfit', sans-serif;
    --radius-lg: 24px;
    --radius-pill: 9999px;
  }
  
  *, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: var(--font);
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 24px;
  }
  
  /* Header */
  .app-header {
    margin-bottom: 40px;
  }
  
  .logo {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
  }
  
  /* Main Content */
  .main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
  
  .converter-wrapper {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
  }
  
  .exchange-boxes-wrapper {
    position: relative;
  }
  
  /* Exchange Boxes */
  .exchange-box {
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
  }
  
  .box-top {
    background-color: var(--bg-box-top);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: 40px; /* Space for the swap button overlap */
  }
  
  .box-bottom {
    background-color: var(--bg-box-bottom);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding-top: 40px; /* Space for the swap button overlap */
  }
  
  .box-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
  
  .amount-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .amount-input, .result-value {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 2.5rem;
    font-weight: 500;
    width: 100%;
    max-width: 200px;
    -moz-appearance: textfield; /* Hide spinner in Firefox */
  }

  /* Hide spinner in Chrome/Safari/Edge */
  .amount-input::-webkit-outer-spin-button,
  .amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  
  .amount-input::placeholder {
    color: #A09E96;
  }
  
  .funds-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
  }
  
  .currency-selector-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }
  
  .funds-amount {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
  }
  
  /* Currency Select Dropdown (White Pills) */
  .cs-wrapper {
    position: relative;
  }
  
  .cs-trigger {
    background-color: var(--bg-white);
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  }
  
  .cs-flag {
    font-size: 1.2rem;
  }
  
  .cs-code {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
  }
  
  .cs-chevron {
    color: var(--text-main);
  }
  
  .cs-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 100;
    overflow: hidden;
  }
  
  .cs-panel.open {
    display: block;
  }
  
  .cs-search-row {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .cs-search {
    width: 100%;
    background: #f8f8f8;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    font-family: var(--font);
    font-size: 0.9rem;
  }
  
  .cs-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
  }
  
  .cs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
  }
  
  .cs-item:hover {
    background-color: #f5f5f5;
  }
  .cs-item.hidden { display: none; }
  .cs-empty { padding: 16px; text-align: center; color: var(--text-muted); display: none; font-size: 0.9rem;}
  
  /* Swap Button */
  .swap-container {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 10;
    padding: 0 24px;
    pointer-events: none; /* Let clicks pass through the line */
  }
  
  .swap-line {
    height: 2px;
    background-color: var(--bg-white);
  }
  
  .line-left {
    flex: 1;
  }
  
  .line-right {
    flex: 1;
  }
  
  .swap-btn {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-white);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin: 0 16px;
    transition: transform 0.2s;
  }
  
  .swap-btn:hover {
    transform: scale(1.05);
  }
  
  /* Convert Button */
  .convert-btn {
    margin-top: 16px;
    background-color: var(--btn-black);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-lg);
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  
  .convert-btn:hover {
    background-color: #333;
  }
  
  .btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  .convert-btn.loading .btn-label, .convert-btn.loading svg { display: none; }
  .convert-btn.loading .btn-spinner { display: block; }
  
  @keyframes spin { to { transform: rotate(360deg); } }
  
  /* Footer Rates */
  .rate-footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  
  /* Copyright Footer */
  .copyright-footer {
    margin-top: 48px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
  }
