/**
 * BuildCalcWorld - Calculator Styles
 * Styles for the Metalcom calculator and other calculators
 */

/* =====================================================
   CALCULATOR LAYOUT
   ===================================================== */
.metalcom-calculator {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: var(--space-6);
    min-height: 600px;
}

@media (max-width: 1024px) {
    .metalcom-calculator {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.calc-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.walls-section,
.results-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.section-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* =====================================================
   WALLS LIST
   ===================================================== */
.walls-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 400px;
    overflow-y: auto;
}

.no-walls {
    color: var(--text-tertiary);
    text-align: center;
    padding: var(--space-6);
    font-size: var(--text-sm);
}

.wall-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    transition: border-color 0.2s;
}

.wall-card:hover {
    border-color: var(--primary-500);
}

.wall-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.wall-number {
    font-weight: 600;
    color: var(--primary-400);
    font-size: var(--text-sm);
}

.remove-wall-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-1);
    font-size: 14px;
    line-height: 1;
    transition: color 0.2s;
}

.remove-wall-btn:hover {
    color: var(--error);
}

.wall-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.wall-inputs .full-width {
    grid-column: 1 / -1;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.input-group label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}

.input-group input,
.input-group select {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    color: var(--text-primary);
    font-size: var(--text-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* =====================================================
   RESULTS SECTION
   ===================================================== */
.results-section h3 {
    margin-bottom: var(--space-4);
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.result-item.highlight {
    background: linear-gradient(135deg, var(--primary-900), var(--primary-800));
    border: 1px solid var(--primary-600);
}

.result-item.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.result-label {
    color: var(--text-secondary);
}

.result-item.highlight .result-label,
.result-item.highlight .result-value {
    color: var(--text-primary);
}

.result-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* =====================================================
   PREVIEW PANEL
   ===================================================== */
.calc-preview {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
}

.view-toggle {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 2px;
}

.view-btn {
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary-600);
    color: white;
}

.preview-canvas {
    flex: 1;
    position: relative;
    min-height: 400px;
}

.preview-canvas canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    gap: var(--space-1);
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
.walls-list::-webkit-scrollbar {
    width: 6px;
}

.walls-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.walls-list::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

.walls-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-secondary);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .metalcom-calculator {
        min-height: auto;
    }

    .calc-preview {
        order: -1;
    }

    .preview-canvas {
        min-height: 300px;
    }

    .wall-inputs {
        grid-template-columns: 1fr;
    }
}