/* TGC Calculator Frontend Styles */
.tgc-calculator {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    max-width: 800px;
    margin: 20px auto;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tgc-calc-header {
    margin-bottom: 20px;
    text-align: center;
}

.tgc-calc-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

/* Steps Progress */
.tgc-calc-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    padding: 0 10px;
}

.tgc-calc-progress::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.tgc-calc-step {
    position: relative;
    z-index: 2;
    background: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #999;
}

.tgc-calc-step.active {
    border-color: #05668d;
    /* Primary Blue */
    background: #05668d;
    color: #fff;
}

/* Form Content */
.tgc-step-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tgc-step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tgc-field-group {
    margin-bottom: 20px;
}

.tgc-field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tgc-input-wrapper {
    position: relative;
}

.tgc-grid-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.tgc-option-card {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.tgc-option-card:hover {
    border-color: #427aa1;
    background: #f8f9fa;
}

.tgc-option-card.selected {
    border-color: #05668d;
    background: #ebf2fa;
    color: #05668d;
    font-weight: 600;
}

.tgc-slider-container {
    padding: 10px 0;
}

input[type="range"] {
    width: 100%;
}

.tgc-range-value {
    margin-top: 5px;
    text-align: right;
    font-weight: bold;
    color: #05668d;
}

/* Actions */
.tgc-calc-actions {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tgc-btn-next,
.tgc-btn-prev {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.tgc-btn-next {
    background: #05668d;
    color: #fff;
}

.tgc-btn-next:hover {
    background: #427aa1;
}

.tgc-btn-prev {
    background: #e0e0e0;
    color: #333;
}

.tgc-btn-prev:hover {
    background: #d0d0d0;
}

/* Results */
.tgc-results-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #05668d;
}

.tgc-total-cost {
    font-size: 2em;
    color: #05668d;
    font-weight: 700;
    margin: 10px 0;
}

.tgc-breakdown-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

.tgc-breakdown-table td {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}


.tgc-breakdown-table tr:last-child td {
    border-bottom: none;
}

/* Planning Calculator Styles */
.tgc-planning-calc .tgc-option-card {
    text-align: left;
    font-size: 1.1em;
    padding: 20px;
}

.tgc-progress-bar-simple {
    background: #f0f0f0;
    height: 6px;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.tgc-bar-fill {
    background: #05668d;
    height: 100%;
    transition: width 0.3s ease;
}

.tgc-result-card {
    text-align: center;
    padding: 40px 20px;
    border-radius: 8px;
    color: #fff;
}

.tgc-result-card.success {
    background: #28a745;
}

.tgc-result-card.fail {
    background: #dc3545;
}

.tgc-result-card.warn {
    background: #ffc107;
    color: #333;
}

#tgc-result-icon .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
}

#tgc-result-title {
    font-size: 2em;
    margin-bottom: 10px;
    color: inherit;
}


/* Soundproofing Calc Styles */
.tgc-rec-card {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 20px 0;
}

.tgc-rec-card h4 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #05668d;
    display: inline-block;
    padding-bottom: 5px;
}

#res-upgrades-list {
    padding-left: 20px;
    margin-bottom: 0;
}

#res-upgrades-list li {
    margin-bottom: 10px;
    color: #555;
}


/* Space Planner Styles */
.tgc-planner-container {
    display: flex;
    gap: 20px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.tgc-planner-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.tgc-palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: grab;
    background: #fff;
}

.tgc-palette-item:hover {
    background: #f0f7ff;
    border-color: #05668d;
}

.tgc-item-preview {
    width: 20px;
    height: 20px;
    background: #ccc;
    border: 1px solid #999;
}

.tgc-item-preview.desk {
    background: #8d6e63;
}

.tgc-item-preview.chair {
    background: #37474f;
    border-radius: 50%;
}

.tgc-item-preview.sofa {
    background: #5d4037;
    border-radius: 4px;
}

.tgc-item-preview.storage {
    background: #ffcc80;
}

.tgc-item-preview.plant {
    background: #66bb6a;
    border-radius: 50%;
}

.tgc-planner-main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: auto;
    min-height: 500px;
}

.tgc-room-canvas {
    background: #fff;
    border: 3px solid #333;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    /* Grid Size: 1px = 1cm? No, let's say 40px = 1m */
    background-image:
        linear-gradient(#f0f0f0 1px, transparent 1px),
        linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
    background-size: 40px 40px;
    /* 1m grid */
    background-position: -1px -1px;
    overflow: hidden;
    /* Items stay in room */
}

.tgc-placed-item {
    position: absolute;
    cursor: grab;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    color: #fff;
    user-select: none;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.tgc-placed-item.desk {
    background: #8d6e63;
    border: 1px solid #5d4037;
}

.tgc-placed-item.chair {
    background: #37474f;
    border-radius: 50%;
    border: 1px solid #000;
}

.tgc-placed-item.sofa {
    background: #5d4037;
    border-radius: 4px;
}

.tgc-placed-item.storage {
    background: #ffcc80;
    border: 1px solid #f57c00;
    color: #333;
}

.tgc-placed-item.plant {
    background: #66bb6a;
    border-radius: 50%;
    border: 1px solid #2e7d32;
}

.tgc-placed-item .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 14px;
    cursor: pointer;
    font-size: 10px;
    display: none;
}

.tgc-placed-item:hover .remove-btn {
    display: block;
}