/* BMTC AI Interior Design Tool Stylesheet - APP UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
    --primary: #C9A84C;
    --primary-hover: #E8C96E;
    --bg-dark: #121212;
    --bg-card: rgba(44, 44, 44, 0.6);
    --bg-card-solid: #1E1E1E;
    --text-light: #FFFFFF;
    --text-muted: #A0A0A0;
    --text-dark: #121212;
    --error: #FF4D4D;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --app-padding: 20px;
    --border-radius: 16px;
    --border-radius-sm: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Background Gradients */
.app-bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% -20%, rgba(201, 168, 76, 0.15) 0%, rgba(18, 18, 18, 1) 60%);
    z-index: -1;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-light);
}

.text-primary {
    color: var(--primary);
}

a {
    color: var(--primary);
    text-decoration: none;
}

.app-container {
    width: 100%;
    max-width: 600px; /* App-like max width even on desktop */
    margin: 0 auto;
    padding: 0 var(--app-padding);
}

/* Top App Bar */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    position: sticky;
    top: 0;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-weight: bold;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Header Text */
.app-title {
    margin: 20px 0 10px;
    font-size: 2rem;
    line-height: 1.2;
}

.app-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* Glassmorphism Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(255, 255, 255, 0.08);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 40px;
    color: var(--text-light);
}

select.form-control option {
    background-color: #1E1E1E; /* Solid background for options */
    color: var(--text-light);
    padding: 10px;
}

/* Upload Area - APP style */
.upload-area {
    border: 2px dashed rgba(201, 168, 76, 0.4);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background-color: rgba(201, 168, 76, 0.03);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area.has-image {
    padding: 0;
    border: 2px solid var(--primary);
}

.upload-icon {
    width: 50px;
    height: 50px;
    background: rgba(201, 168, 76, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.upload-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
}

.upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

#file-input { display: none; }

.image-preview {
    display: none;
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: calc(var(--border-radius) - 2px);
}

.change-image-btn {
    display: none;
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(4px);
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2);
}

.upload-area.has-image .change-image-btn { display: block; }

/* Grid Selectors (Styles, Types) */
.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip-input { display: none; }

.chip-label {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.chip-input:checked + .chip-label {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

/* Two column row */
.form-row {
    display: flex;
    gap: 15px;
}
.form-col { flex: 1; }

/* Buttons */
.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #b3923a);
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Fixed Bottom Action Bar */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px var(--app-padding);
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.05);
    z-index: 90;
    display: flex;
    justify-content: center;
}

.bottom-action-bar .btn {
    max-width: 600px;
}

/* Bottom Navigation (App Style) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #1A1A1A;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 15px;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 15px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item.active svg {
    fill: rgba(201, 168, 76, 0.2);
}

/* Modal Overlay (App Bottom Sheet style) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Align bottom */
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-card-solid);
    border-radius: 24px 24px 0 0;
    padding: 30px 20px 40px;
    width: 100%;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-drag-handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin: -10px auto 20px;
}

/* Loader App Style */
.app-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(201, 168, 76, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result Screen specific */
.result-image-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.result-image-card img {
    width: 100%;
    display: block;
}

.result-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(5px);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(201,168,76,0.3);
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Free Badge ===== */
.free-badge {
    background: rgba(201,168,76,0.15);
    color: var(--primary);
    border: 1px solid rgba(201,168,76,0.35);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ===== Payment Modal ===== */
#payment-modal .modal-content {
    text-align: center;
}
