/* Three-line layout — designed to survive narrow Joomla module positions
   regardless of the host template's CSS. The !important rules win against
   common overrides like Bootstrap's `.form-control { display: block;
   width: 100%; }` or templates that force `display: block` on form fields. */

.currency-converter {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    font: inherit;
}

.currency-converter .cc-line {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* Allow flex children to shrink below their intrinsic content width. */
.currency-converter .cc-line > * {
    min-width: 0 !important;
}

.currency-converter .cc-label {
    flex: 0 0 auto !important;
    display: inline-block !important;
    width: auto !important;
    font-weight: 600;
    white-space: nowrap;
}

.currency-converter input,
.currency-converter select,
.currency-converter button {
    padding: 8px 10px;
    margin: 0;
    box-sizing: border-box;
    font: inherit;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    line-height: normal;
    display: inline-block;
}

/* Line 1: amount input fills the rest of the row.
   `flex: 1 1 0` + `min-width: 0` lets it shrink as small as needed
   so the "Convert" label always stays inline next to it. */
.currency-converter .cc-amount-line .cc-amount {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
}

/* Line 2: equal-width selects with arrow between */
.currency-converter .cc-currencies-line .cc-from,
.currency-converter .cc-currencies-line .cc-to {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
}

.currency-converter .cc-arrow {
    flex: 0 0 auto !important;
    color: #666;
    font-weight: 600;
    padding: 0 2px;
    user-select: none;
}

/* Line 3: small swap on the left, primary Convert filling the rest */
.currency-converter .cc-actions-line .cc-swap {
    flex: 0 0 auto !important;
    background: transparent;
    line-height: 1;
    padding: 8px 12px;
    font-size: 1.15em;
    cursor: pointer;
}
.currency-converter .cc-actions-line .cc-swap:hover:not([disabled]) {
    background: #f5f5f5;
}

.currency-converter .cc-actions-line .cc-convert {
    flex: 1 1 auto !important;
    width: auto !important;
    cursor: pointer;
    background: #2c6bed;
    color: #fff;
    border-color: #2c6bed;
    font-weight: 600;
}
.currency-converter .cc-actions-line .cc-convert:hover:not([disabled]) {
    background: #1f54c2;
    border-color: #1f54c2;
}

.currency-converter [disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

.currency-converter .cc-result {
    margin-top: 4px;
    font-weight: 600;
    min-height: 1.4em;
    word-break: break-word;
}

.currency-converter .cc-result.is-error {
    color: #b00020;
    font-weight: 500;
}
