/* FreeTakeoff.tools - Shared Calculator Styles */

/* Product Line */
.product-line {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.product-line-header {
    background: var(--bg-line);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.product-line-number {
    background: var(--accent);
    color: var(--bg-dark);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.product-line-header input {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
}

.product-line-header input:hover {
    border-color: var(--border);
}

.product-line-header input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-input);
}

.product-line-header input::placeholder {
    color: var(--text-muted);
}

.btn-remove-line {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    line-height: 1;
    border-radius: 4px;
}

.btn-remove-line:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.product-line-options {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.option-group label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.option-group select,
.option-group input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
}

.option-group select:focus,
.option-group input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Spec/Notes Row */
.spec-row {
    padding: 0.5rem 1rem 0.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.spec-row label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.spec-row textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    resize: vertical;
    min-height: 2.5rem;
}

.spec-row textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.spec-row textarea::placeholder {
    color: var(--text-muted);
}

/* Area Table */
.areas-section {
    padding: 0.75rem 1rem;
}

.areas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.areas-table th {
    text-align: left;
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.5rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.areas-table th.dim-col,
.areas-table th.result-col {
    text-align: center;
    width: 70px;
}

.areas-table th:last-child {
    width: 36px;
}

.areas-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.areas-table tr:last-child td {
    border-bottom: none;
}

.areas-table input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
}

.areas-table input:hover {
    border-color: var(--border);
}

.areas-table input:focus {
    outline: none;
    border-color: var(--accent);
}

.areas-table input[type="number"] {
    text-align: center;
}

.areas-table input::placeholder {
    color: var(--text-muted);
}

.area-sqft,
.area-gallons,
.area-perim {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.btn-remove-area {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.15s, transform 0.1s;
}

.btn-remove-area:hover {
    color: var(--danger);
    opacity: 1;
    transform: scale(1.1);
}

.btn-add-area {
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.15s;
}

.btn-add-area:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Line Subtotals */
.line-subtotals {
    background: var(--bg-line);
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
}

.line-subtotal-item {
    display: flex;
    gap: 0.35rem;
}

.line-subtotal-label {
    color: var(--text-secondary);
}

.line-subtotal-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--accent);
}

/* Add Product Line Button */
.btn-add-line {
    width: 100%;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    padding: 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 1.5rem;
}

.btn-add-line:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Grand Totals */
.grand-totals {
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 8px;
    overflow: hidden;
}

.grand-totals-header {
    background: var(--accent);
    color: var(--bg-dark);
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.grand-totals-content {
    padding: 1rem;
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.total-item {
    background: var(--bg-input);
    border-radius: 6px;
    padding: 0.75rem;
}

.total-item-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.total-item-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
}

.total-item-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.total-item.highlight {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Per-Line Totals */
.per-line-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.combined-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
}

.per-line-total {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.per-line-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.per-line-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.per-line-notes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.2rem 0;
}

.per-line-spec {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.per-line-area {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

.per-line-materials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
}

.per-line-mat {
    display: flex;
    gap: 0.3rem;
}

.per-line-mat-label {
    color: var(--text-secondary);
}

.per-line-mat-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 640px) {
    .product-line-options {
        grid-template-columns: repeat(2, 1fr);
    }
    .totals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
