/* ========================================================
   AI Furniture Design App Styles
   Curated Palette, Glassmorphism, Premium Stage stage-ready
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

.ai-furniture-app-wrapper {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at 10% 20%, rgb(19, 20, 24) 0%, rgb(32, 34, 42) 100%);
    color: #e2e8f0;
    padding: 60px 20px;
    min-height: 80vh;
}

.ai-furniture-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
.ai-app-header {
    text-align: center;
    margin-bottom: 40px;
}

.ai-app-title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.ai-app-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Step Progress Indicator */
.ai-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 25px;
    border-radius: 16px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.progress-step {
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
    position: relative;
    transition: all 0.3s ease;
}

.progress-step.active {
    color: #818cf8;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(129, 140, 248, 0.3);
}

.progress-step.completed {
    color: #34d399;
}

/* Card layout & Sections */
.ai-card-body {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-step-section {
    display: none;
}

.ai-step-section.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styles */
.form-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 18px;
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Checkbox Cards */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-card:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.checkbox-card.checked {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
}

.checkbox-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-card input[type="checkbox"] {
    margin-top: 4px;
    accent-color: #6366f1;
}

.checkbox-details {
    display: flex;
    flex-direction: column;
}

.checkbox-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.checkbox-desc {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Upload & Camera Zones */
.upload-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.upload-drag-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-drag-zone:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.03);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.drag-text {
    color: #94a3b8;
    margin-bottom: 15px;
}

.upload-preview-container {
    width: 100%;
    max-height: 350px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.upload-preview-container img {
    width: 100%;
    max-height: 350px;
    object-fit: contain;
}

.upload-preview-container .btn-danger {
    position: absolute;
    top: 15px;
    right: 15px;
}

.or-separator {
    text-align: center;
    position: relative;
    margin: 20px 0;
}

.or-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.or-separator span {
    background: #20222a;
    padding: 0 15px;
    color: #64748b;
    position: relative;
    z-index: 2;
    font-weight: 600;
    font-size: 0.85rem;
}

.camera-capture-zone {
    text-align: center;
}

/* Style Grid */
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.style-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.style-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.style-card.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.15);
}

.style-card-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.style-card-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* Inspiration Upload Row */
.inspiration-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.inspiration-box {
    width: 100px;
    height: 100px;
    border: 1.5px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: #64748b;
    transition: all 0.3s ease;
}

.inspiration-box:hover {
    border-color: #6366f1;
    color: #818cf8;
}

.inspiration-preview-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.inspiration-thumb {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.inspiration-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inspiration-thumb .delete-thumb {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
}

/* Button UI */
.btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(99, 102, 241, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-accent {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(52, 211, 153, 0.2);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(52, 211, 153, 0.3);
}

.btn-large {
    padding: 16px 36px;
    font-size: 1.05rem;
}

.btn-muted {
    background: transparent;
    color: #64748b;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-muted:hover {
    background: rgba(255, 255, 255, 0.02);
    color: #fff;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Loader Styles */
.ai-loader-container {
    padding: 60px 0;
}

.ai-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-status {
    color: #94a3b8;
    margin-top: 10px;
    font-style: italic;
}

.loader-facts {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    max-width: 400px;
    margin: 40px auto 0;
}

.fact-title {
    font-weight: 600;
    color: #818cf8;
    margin-bottom: 5px;
}

.fact-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

/* Concepts/Variations Grid */
.concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.concept-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.concept-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
}

.concept-card.active {
    border-color: #6366f1;
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.2);
}

.concept-img-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #111;
}

.concept-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.concept-card:hover .concept-img-wrapper img {
    transform: scale(1.05);
}

.concept-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.concept-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
}

.concept-desc {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Summary Card */
.design-summary-card {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
}

.summary-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-details p {
    margin: 0;
    font-size: 0.95rem;
    color: #cbd5e1;
}

.summary-details strong {
    color: #fff;
}

/* CNC Table */
.table-responsive {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cnc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.01);
}

.cnc-table th {
    background: rgba(255, 255, 255, 0.04);
    padding: 16px 20px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cnc-table td {
    padding: 16px 20px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cnc-table tr:last-child td {
    border-bottom: none;
}

.cnc-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: #fff;
}

.text-center {
    text-align: center;
}

.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 30px; }
.or-separator { margin: 15px 0; }
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
