/* ============================================
   BUILD TEST PAGE STYLES
   Matching ASHLI Main Site Aesthetic
   ============================================ */

/* Import shared CSS variables from main styles.css */
:root {
    --base-teal: #66bcb4;
    --base-yellow: #edc55b;
    --base-orange: #ec802b;
    --base-beige: #dcc1a3;
    --comp-dark-teal: #005b74;
    --comp-gold: #d0ac4b;
    --comp-red: #b63939;
    --comp-pink: #df62a2;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --header-font: 'Playfair Display', serif;
    --body-font: 'Inter', sans-serif;
}

/* ============================================
   BASE LAYOUT
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--base-orange);
    min-height: 100vh;
    font-family: var(--body-font);
    color: var(--text-dark);
    overflow-x: hidden;
}

.build-test-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem 0;
}

.back-home-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-home-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.page-title {
    font-family: var(--header-font);
    font-size: 2.5rem;
    color: white;
    text-align: center;
    flex: 1;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

/* ============================================
   STEP SYSTEM
   ============================================ */

.build-step {
    display: none;
    animation: fadeInUp 0.6s ease;
}

.build-step.active-step {
    display: block;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--base-yellow), var(--base-orange));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.step-title {
    font-family: var(--header-font);
    font-size: 2rem;
    color: white;
    margin: 0;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
}

/* ============================================
   FORM STYLING
   ============================================ */

.build-step h2 {
    font-family: var(--header-font);
    font-size: 2rem;
    color: white;
    margin-bottom: 2rem;
}

.build-step p {
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.build-step form {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.build-step label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: white;
    font-size: 1rem;
}

.build-step input,
.build-step textarea,
.build-step select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    transition: all 0.3s ease;
    font-family: var(--body-font);
}

.build-step input:focus,
.build-step textarea:focus,
.build-step select:focus {
    outline: none;
    border-color: var(--base-yellow);
    background: white;
    box-shadow: 0 0 0 3px rgba(237, 197, 91, 0.3);
}

.build-step input::placeholder,
.build-step textarea::placeholder {
    color: rgba(44, 62, 80, 0.5);
}

.build-step textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* ============================================
   BUTTONS
   ============================================ */

.build-step button,
button {
    background: linear-gradient(135deg, var(--base-yellow), var(--base-orange));
    color: var(--text-dark);
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--body-font);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.build-step button:hover,
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.build-step button:active,
button:active {
    transform: translateY(0);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================
   PRODUCTS SECTION
   ============================================ */

#product-list-container {
    margin-bottom: 1.5rem;
}

.product-entry {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    backdrop-filter: blur(10px);
}

.product-entry h4 {
    color: white;
    margin-bottom: 1rem;
    font-family: var(--header-font);
    font-size: 1.2rem;
}

.remove-product-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(182, 57, 57, 0.8) !important;
    color: white !important;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.remove-product-btn:hover {
    background: rgba(182, 57, 57, 1) !important;
}

#add-product-btn {
    background: transparent !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    color: white !important;
}

#add-product-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: var(--base-yellow) !important;
}

.prod-service-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================
   TIME AND DAY PICKER STYLES
   ============================================ */

.time-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.day-selector-wrapper,
.time-picker-wrapper {
    flex: 1;
    min-width: 200px;
}

.sub-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

.day-selector-wrapper select,
.time-picker-wrapper input[type="time"] {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    transition: all 0.3s ease;
    font-family: var(--body-font);
}

.day-selector-wrapper select:focus,
.time-picker-wrapper input[type="time"]:focus {
    outline: none;
    border-color: var(--base-yellow);
    background: white;
    box-shadow: 0 0 0 3px rgba(237, 197, 91, 0.3);
}

input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: brightness(0.8);
}

/* ============================================
   FAQ SECTION
   ============================================ */

#faq-list {
    margin-bottom: 2rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.faq-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: white;
}

.faq-item input,
.faq-item textarea {
    margin-bottom: 0.5rem;
}

/* ============================================
   SUCCESS SECTION
   ============================================ */

#step-5 {
    text-align: center;
}

#success-msg {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    color: white;
    font-size: 1.1rem;
    line-height: 1.6;
}

#summary-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    text-align: left;
    color: white;
}

#summary-container h3 {
    font-family: var(--header-font);
    color: var(--base-yellow);
    margin-bottom: 1rem;
}

#summary-container p,
#summary-container ul {
    margin-bottom: 1rem;
}

/* ============================================
   TEST CHAT SECTION - MATCHING DEMO STYLE
   ============================================ */

#chatbox-container {
    max-width: 800px;
    margin: 0 auto 2rem;
}

#chat-welcome-msg {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    color: white;
    text-align: center;
    line-height: 1.6;
}

/* MODERN CHAT CONTAINER - MATCHING DEMO */
.chatbox {
    background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 91, 116, 0.15);
    overflow: hidden;
    border: 1px solid rgba(102, 188, 180, 0.2);
    min-height: 450px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

/* Chat Messages Area */
#chatbox {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #fafffe 0%, #f5fbfa 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Scrollbar styling for chatbox */
#chatbox::-webkit-scrollbar {
    width: 6px;
}

#chatbox::-webkit-scrollbar-track {
    background: rgba(102, 188, 180, 0.1);
    border-radius: 3px;
}

#chatbox::-webkit-scrollbar-thumb {
    background: rgba(102, 188, 180, 0.4);
    border-radius: 3px;
}

#chatbox::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 188, 180, 0.6);
}

/* MESSAGE STYLING - MATCHING DEMO */
.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: messageSlideIn 0.4s ease-out;
    margin-bottom: 0;
}

.user-message {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
    border: 2px solid rgba(102, 188, 180, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-avatar .avatar-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
}

.message-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

/* Bot Message Styling */
.bot-message .message-bubble {
    background: linear-gradient(135deg, var(--comp-dark-teal), var(--base-teal));
    color: white;
    border-radius: 18px 18px 18px 4px;
}

/* User Message Styling */
.user-message .message-bubble {
    background: linear-gradient(135deg, var(--base-yellow), var(--base-orange));
    color: var(--text-dark);
    border-radius: 18px 18px 4px 18px;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--base-yellow), var(--base-orange));
    border: 2px solid rgba(237, 197, 91, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-weight: 600;
}

.message-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Legacy chat-message class support */
.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: messageSlideIn 0.4s ease-out;
    margin-bottom: 16px;
}

.chat-message.bot {
    flex-direction: row;
}

.chat-message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

/* MODERN INPUT AREA - MATCHING DEMO */
#chat-input-form {
    padding: 20px;
    background: white;
    border-top: 1px solid rgba(102, 188, 180, 0.1);
    flex-shrink: 0;
    margin: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: linear-gradient(135deg, #f8fffe, #ffffff);
    border: 2px solid rgba(102, 188, 180, 0.2);
    border-radius: 24px;
    padding: 6px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--base-teal);
    box-shadow: 0 0 0 4px rgba(102, 188, 180, 0.1);
}

#chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    resize: none;
    max-height: 100px;
    min-height: 20px;
    color: var(--text-dark);
    font-family: var(--body-font);
    margin-bottom: 0;
}

#chat-input::placeholder {
    color: rgba(44, 62, 80, 0.5);
}

#chat-input-form button,
.send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--comp-dark-teal), var(--base-teal)) !important;
    border: none;
    border-radius: 50%;
    color: white !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    padding: 0 !important;
    margin-bottom: 0;
}

#chat-input-form button:hover,
.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 91, 116, 0.4);
}

#chat-input-form button:active,
.send-btn:active {
    transform: scale(0.95);
}

.chat-restriction-msg {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* TYPING INDICATOR */
.typing-indicator .message-bubble {
    background: rgba(102, 188, 180, 0.1) !important;
    border: 1px solid rgba(102, 188, 180, 0.2);
    color: var(--comp-dark-teal) !important;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--comp-dark-teal);
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.product-description {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.5;
    margin: 10px 0;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

/* Responsive Chat Adjustments */
@media (max-width: 768px) {
    #chatbox-container {
        margin: 0 0 2rem;
    }
    
    .chatbox {
        border-radius: 16px;
        min-height: 350px;
    }
    
    #chatbox {
        padding: 16px;
    }
    
    #chat-input-form {
        padding: 16px;
    }
    
    .message-bubble {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .chatbox {
        min-height: 300px;
    }
    
    .message-bubble {
        font-size: 0.9rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .build-test-container {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .back-home-btn {
        justify-content: center;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .step-header {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .step-title {
        font-size: 1.5rem;
    }
    
    .build-step form {
        padding: 1.5rem;
    }
    
    .button-group,
    .prod-service-buttons {
        flex-direction: column;
    }
    
    .chatbox {
        min-height: 300px;
    }
    
    #chat-input-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.75rem;
    }
    
    .build-step input,
    .build-step textarea,
    .build-step button {
        font-size: 0.9rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 40px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
}

.loading-content p {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.loading-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: white;
    border-radius: 3px;
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Pulsing dots animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}
