/* Main Wrapper - Transparent/Clean */
.adps-wrapper {
    max-width: 900px;
    margin: 0 auto;
    font-family: inherit;
    /* Inherit theme font */
    color: #333;
    --adps-primary-color: #66cc33;
}

.adps-hidden {
    display: none !important;
}

/* Progress Bar */
.adps-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.adps-progress-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.adps-progress-step {
    font-weight: 600;
    color: #aaa;
    font-size: 0.95rem;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    z-index: 1;
    transition: all 0.3s;
}

.adps-progress-step.active {
    color: var(--adps-primary-color);
    /* Theme Color? */
    border-bottom: 2px solid var(--adps-primary-color);
}

/* Drop Zone */
.adps-drop-zone {
    border: 2px dashed #b0c4de;
    background: rgba(255, 255, 255, 0.5);
    padding: 60px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.adps-drop-zone:hover {
    border-color: var(--adps-primary-color);
    background: rgba(255, 255, 255, 0.8);
}

.adps-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* Viewer Section */
.adps-viewer-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

#adps-3d-canvas {
    width: 100%;
    height: 450px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 20px;
    position: relative;
}

/* Controls (Scale/Unit) */
.adps-viewer-controls {
    display: flex;
    justify-content: space-between;
    background: #f4f4f4;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    align-items: center;
}

.adps-control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.adps-radio-inline label {
    margin-right: 15px;
    cursor: pointer;
}

/* Stats Table */
.adps-stats-table-wrapper h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.adps-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.adps-stats-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.adps-stats-table tr:last-child td {
    border-bottom: none;
}

.adps-stats-table td:first-child {
    color: #666;
    font-weight: 500;
    width: 40%;
}

.adps-stats-table td:last-child {
    font-weight: 700;
    color: #333;
}

/* Tech Cards */
.adps-tech-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.adps-tech-card {
    flex: 1;
    border: 2px solid #eee;
    background: #fff;
    /* Ensure contrast if main bg is not white */
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.adps-tech-card:hover {
    border-color: #999;
}

.adps-tech-card:has(input:checked) {
    border-color: var(--adps-primary-color);
    background: #f0f8ff;
}

.adps-tech-title {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.adps-tech-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    display: block;
}

/* Material Grid (NEW) */
.adps-material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.adps-mat-card {
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    /* Center content */
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.adps-mat-card:hover {
    border-color: #aaa;
}

.adps-mat-card.selected {
    border-color: var(--adps-primary-color);
    background: #e6f7ff;
    box-shadow: 0 0 0 1px var(--adps-primary-color);
}

.adps-mat-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.adps-mat-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Buttons */
.adps-btn-row {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 20px;
}

.adps-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s;
}

.adps-btn-primary {
    background: var(--adps-primary-color);
    color: #fff;
}

.adps-btn-primary:hover {
    background: #005177;
}

.adps-btn-secondary {
    background: #eee;
    color: #333;
}

.adps-btn-text {
    background: transparent;
    color: #666;
    text-decoration: underline;
    padding: 12px 0;
}

/* Form inputs */
.adps-input,
.adps-select,
textarea,
input[type=text],
input[type=email] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.adps-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.adps-col {
    flex: 1;
}

/* Loader */
.adps-overlay {
    background: rgba(255, 255, 255, 0.85);
    /* Slightly transparent */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    z-index: 99;
    backdrop-filter: blur(2px);
}

.adps-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--adps-primary-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 15px;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Success */
.adps-success-msg {
    text-align: center;
    padding: 40px;
}

.adps-check-icon {
    font-size: 60px;
    color: #4caf50;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .adps-tech-selector {
        flex-direction: column;
    }

    .adps-row {
        flex-direction: column;
        gap: 0;
    }

    .adps-viewer-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}