/* Layout & Typography Overrides */
h2 {
    margin-top: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.app-hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.mt-medium {
    margin-top: 15px;
}

/* Loader */
.loader-container {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--abstract-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 30px;
}

.loader-progress {
    width: 100%;
    max-width: 400px;
    height: 6px;
    margin: 15px auto;
    display: block;
}

.loader-spinner {
    display: none;
    animation: spin 1.5s linear infinite;
    font-size: 1.5em;
    margin-top: 10px;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* Inputs & Forms */
.calc-section { margin-bottom: 40px; }

.calc-section-box {

    background-color: var(--abstract-bg);
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-weight: 600; font-size: 14px; }
.input-group.grow { flex-grow: 1; }

/* New Hint Style */
.input-hint {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.7;
    font-style: italic;
    display: block;
}

.std-input, .std-select {
    padding: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--paper-bg);
    color: var(--text-color);
    font-size: 16px;
    width: 100%;
    border-radius: 4px;
    font-family: inherit;
}

.std-input:focus, .std-select:focus {
    outline: 1px solid var(--accent-color);
}

.action-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.unit-label {
    min-width: 8rem;
    font-size: 0.9em;
    opacity: 0.8;
}

/* Buttons */
.btn-action {
    padding: 0 24px;
    background-color: var(--text-color);
    color: var(--paper-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: 'EB Garamond', 'Times New Roman', Times, serif;
    height: 44px; /* Matches input height approx */
    border-radius: 4px;
    transition: opacity 0.2s;
}

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

.btn-reset {
    background: var(--abstract-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    width: 3rem;
    border-radius: 4px;
    font-size: 1.2rem;
    color: var(--text-color);
}

/* Lists */
.list-container {
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    min-height: 50px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--light-border);
    animation: slideIn 0.2s ease;
}

@keyframes slideIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.item-code {
    font-family: monospace;
    font-size: 13px;
    background: var(--text-color);
    color: var(--paper-bg);
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 10px;
}

.btn-remove {
    background: none;
    border: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
}

.empty-state {
    padding: 20px;
    text-align: center;
    opacity: 0.6;
    font-style: italic;
}

/* Search Component */
.search-container {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 50;
}

.autocomplete-wrapper {
    position: relative;
    flex-grow: 1;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--paper-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 4px;
}

.autocomplete-dropdown li {
    padding: 10px;
    border-bottom: 1px solid var(--light-border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-dropdown li:hover, 
.autocomplete-dropdown li.selected {
    background: var(--abstract-bg);
}

.cotation-badge {
    font-weight: bold;
    font-family: monospace;
    margin-left: 10px;
    white-space: nowrap;
}

.error-banner {
    margin-top: 10px;
    color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #c0392b;
    font-size: 0.9em;
}

/* Results Box */
.result-section {
    margin-top: 40px;
    text-align: center;
}

.result-card {
    padding: 10px;
    border: 4px double var(--border-color);
    background: var(--paper-bg);
    display: inline-block;
}

.result-label { text-transform: uppercase; letter-spacing: 1px; font-size: 14px; margin-bottom: 5px; }
.result-value { font-size: 36px; font-weight: bold; font-family: monospace; margin: 10px 0; }
.result-details { font-size: 15px; opacity: 0.8; font-style: italic; font-family: 'EB Garamond', serif; }

/* Sticky Footer */
.total-bar {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.total-summary {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.summary-item { text-align: center; }
.summary-item .label { font-size: 11px; text-transform: uppercase; display: block; opacity: 0.7; }
.summary-item .value { font-size: 22px; font-weight: bold; font-family: monospace; }
.divider { width: 1px; background: var(--light-border); }
