/**
 * CSS for HairColorGPT UMP Integration Personalized Chat Interface
 * - Two-step onboarding UI: Welcome → Preferences → Chat
 * - Responsive design for all devices
 * - Anti-theme-override protection
 * 
 * @package HairColorGPT_UMP_Integration
 * @version 2.0.0
 */

/* =================================================================
   BODY CLASS - Used for ultra-specific CSS targeting
   ================================================================= */

body.hcgpt-overlay-active {
    overflow: hidden !important;
}

/* =================================================================
   FULL-PAGE WELCOME & PREFERENCES OVERLAYS - Modern Card Design
   ================================================================= */

.hcgpt-welcome-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.85) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    backdrop-filter: blur(5px) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    animation: fadeIn 0.3s ease-out !important;
}

.hcgpt-welcome-overlay.hidden,
.hcgpt-welcome-overlay[style*="display: none"],
.hcgpt-welcome-overlay.fade-out {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.hcgpt-chat-container.show,
.hcgpt-chat-container[style*="display: block"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.hcgpt-welcome-screen {
    background: #ffffff !important;
    border-radius: 16px !important;
    max-width: 900px !important;
    width: 95% !important;
    max-height: 80vh !important;
    box-shadow: none !important;
    animation: slideUp 0.4s ease-out !important;
    overflow: auto !important; /* Changed from hidden to auto for scrolling */
    font-family: inherit !important;
    margin: auto !important;
    position: relative !important;
    transform: translateY(0px) !important; /* Changed from -30px to 0px */
}

.welcome-content {
    padding: 40px 50px !important;
}

.welcome-header h2 {
    font-size: 28px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.3 !important;
}

.welcome-subheading {
    font-size: 16px !important;
    color: #444444 !important;
    margin: 21px !important;
    line-height: 1.5 !important;
}

.welcome-features {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 55px !important;
}

.feature-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 16px !important;
    padding: 24px 20px !important;
    background: #f8f9fa !important;
    border-radius: 12px !important;
    border: 1px solid #e9ecef !important;
    transition: none!important;
    min-height: 140px !important;
}

.feature-item:hover {
    background: #f1f3f4 !important;
    transform: none!important;
    box-shadow: none !important;
}

.feature-icon {
    font-size: 32px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.feature-text {
    width: 100% !important;
}

.feature-text h4 {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.3 !important;
}

.feature-text p {
    font-size: 13px !important;
    color: #666 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

.welcome-cta {
    text-align: center !important;
}

body:not(.hcgpt-app-page) .start-chatting-btn {
   background-color: #a044ff!important;
   background-image: linear-gradient(to left,#6a3093,#a044ff)!important;
    color: white !important;
    border: none !important;
    padding: 16px 32px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 24px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    margin-bottom: 20px !important;
    display: block !important;
    width: 100% !important;
    max-width: 280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body:not(.hcgpt-app-page) .start-chatting-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: none !important;
    background-color: #f15f79!important;
    background-image: linear-gradient(to left,#b24592,#f15f79)!important;
}

.remember-choice {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    font-size: 14px !important;
    color: #666 !important;
    cursor: pointer !important;
    margin-top: 20px !important;
    padding: 12px !important;
    background: #f8f9fa !important;
    border-radius: 8px !important;
    border: 1px solid #e9ecef !important;
    transition: all 0.2s ease !important;
}

.remember-choice:hover {
    background: #f1f3f4 !important;
    border-color: #dee2e6 !important;
}

.remember-choice input[type="checkbox"] {
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 1 !important;
    background: white !important;
    border: 2px solid #ccc !important;
    border-radius: 3px !important;
}

.remember-choice input[type="checkbox"]:checked {
    background-color: #4285f4 !important;
    border-color: #4285f4 !important;
}

.remember-choice input[type="checkbox"]:focus {
    outline: 2px solid #4285f4 !important;
    outline-offset: 2px !important;
}

/* =================================================================
   SIMPLE CHAT INTERFACE - Stile Gemini
   ================================================================= */

.hcgpt-chat-interface {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
}

.simple-welcome {
    text-align: center;
    padding: 60px 20px;
}

.simple-welcome h2 {
    font-size: 32px;
    font-weight: 400;
    color: #1a1a1a;
    margin: 0;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #ea4335 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =================================================================
   ANIMATIONS
   ================================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media (max-width: 900px) {
    .hcgpt-welcome-screen {
        max-width: 95%;
        width: 95%;
    }
    
    .welcome-content {
        padding: 30px 25px;
    }
}

@media (max-width: 767.98px) {
    .welcome-features {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 30px;
    }
    
    .feature-item {
        min-height: initial;
        padding: 20px;
    }
    
    .feature-icon {
        font-size: 28px;
    }
    
    .feature-text h4 {
        font-size: 16px;
    }
    
    .feature-text p {
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    .welcome-content {
        padding: 25px 20px;
    }
    
    .welcome-header h2 {
        font-size: 24px;
    }
    
    .welcome-subheading {
        font-size: 15px;
    }
    
    .feature-item {
        padding: 18px;
    }
    
    .feature-icon {
        font-size: 24px;
    }
    
    .feature-text h4 {
        font-size: 15px;
    }
    
    .feature-text p {
        font-size: 12px;
    }
    
    body:not(.hcgpt-app-page) .start-chatting-btn {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    .simple-welcome h2 {
        font-size: 28px;
    }
    
    .simple-welcome {
        padding: 40px 20px;
    }
}

/**
 * CSS per l'interfaccia chat personalizzata HairColorGPT UMP Integration
 * 
 * @package HairColorGPT_UMP_Integration
 * @version 1.0.0
 */

/* Container principale */
.haircolorgpt-chat-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: none;
}

/* Sezione benvenuto */
.haircolorgpt-welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
}

.haircolorgpt-welcome-section h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
}

.personalized-greeting {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

/* Sezione preferenze */
.haircolorgpt-preferences-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.haircolorgpt-preferences-section h4 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.preferences-form {
    display: grid;
    gap: 18px;
}

.preference-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preference-row label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.preference-row select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s ease;
}

.preference-row select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: none;
}

.preference-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.btn-save-preferences {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save-preferences:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: none;
}

.btn-save-preferences:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.save-status {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    opacity: 1;
}

.save-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f1b2b8;
    opacity: 1;
}

.save-status.loading {
    background: #cce7ff;
    color: #0066cc;
    border: 1px solid #99d6ff;
    opacity: 1;
}

/* Interfaccia chat */
.haircolorgpt-chat-interface {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
}

.chat-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.chat-header h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 18px;
}

.chat-description {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.chat-messages:empty::before {
    content: "No messages yet. Start chatting!";
    display: block;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 50px 20px;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    gap: 12px;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.user .message-bubble {
    background: #dfe4fa;
    color: rgb(100, 100, 100);
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-bubble {
    background: #ffffff;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-input-section {
    background: #f8f9fa;
    padding: 20px;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-group textarea {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.3s ease;
}

.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: none;
}

.btn-send-message {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-send-message:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-send-message:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* Azioni rapide */
.haircolorgpt-quick-actions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.haircolorgpt-quick-actions h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    background: white;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.quick-action-btn:hover {
    border-color: #667eea;
    background: #f7f8ff;
    transform: translateY(-1px);
}

/* Indicatore di caricamento */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: none;
    text-align: center;
    z-index: 9999;
}

.loading-indicator::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    margin: 0;
    color: #495057;
    font-size: 14px;
}

/* =================================================================
   BODY OVERLAY STATE
   ================================================================= */

body.hcgpt-overlay-active {
    overflow: hidden;
    height: 100%;
}

/* Ensure overlay covers everything */
.hcgpt-overlay-active .hcgpt-welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Responsive design */
@media (max-width: 767.98px) {
    .haircolorgpt-chat-container {
        margin: 10px;
        padding: 15px;
    }
    
    .haircolorgpt-welcome-section {
        padding: 20px;
    }
    
    .haircolorgpt-preferences-section {
        padding: 20px;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group textarea {
        border-radius: 8px;
    }
    
    .btn-send-message {
        border-radius: 8px;
        align-self: stretch;
    }
    
    .quick-buttons {
        grid-template-columns: 1fr;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .haircolorgpt-chat-container {
        margin: 5px;
        padding: 10px;
    }
    
    .haircolorgpt-welcome-section h3 {
        font-size: 20px;
    }
    
    .personalized-greeting {
        font-size: 14px;
    }
    
    .chat-messages {
        height: 250px;
    }
}




/* Loading state */
body.haircolorgpt-page .suggestion-card.loading,
body .haircolorgpt-chat-container .suggestion-card.loading,
body #page .suggestion-card.loading,
body div.page-wrapper .suggestion-card.loading,
body [class*="haircolorgpt"] .suggestion-card.loading,
.suggestion-card.suggestion-card.suggestion-card.loading {
    opacity: 0.6 !important;
    pointer-events: none !important;
}

/* Responsive adjustments for suggestions */
@media (max-width: 767.98px) {
    body.haircolorgpt-page .suggestion-card,
    body .haircolorgpt-chat-container .suggestion-card,
    body #page .suggestion-card,
    body div.page-wrapper .suggestion-card,
    body [class*="haircolorgpt"] .suggestion-card,
    .suggestion-card.suggestion-card.suggestion-card {
        max-width: calc(22% - 6px) !important;
        flex: 0 0 calc(50% - 6px) !important;
    }
}

@media (max-width: 480px) {
    body.haircolorgpt-page .suggestion-card,
    body .haircolorgpt-chat-container .suggestion-card,
    body #page .suggestion-card,
    body div.page-wrapper .suggestion-card,
    body [class*="haircolorgpt"] .suggestion-card,
    .suggestion-card.suggestion-card.suggestion-card {
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    body.haircolorgpt-page #hcgpt-suggestions-box.suggestion-float,
    body .haircolorgpt-chat-container #hcgpt-suggestions-box.suggestion-float,
    body #page #hcgpt-suggestions-box.suggestion-float,
    body div.page-wrapper #hcgpt-suggestions-box.suggestion-float,
    body [class*="haircolorgpt"] #hcgpt-suggestions-box.suggestion-float {
        gap: 8px !important;
    }
}

/* =================================================================
   PREFERENCES OVERLAY - Card-based form
   ================================================================= */

.preferences-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 10px !important;
    margin: 15px 0 !important;
}

.preference-card {
    background: #f8f9fa !important;
    border-radius: 12px !important;
    padding: 10px !important;
    border: 1px solid #e9ecef !important;
    transition: all 0.2s ease !important;
}

.preference-card:hover {
    background: #f1f3f4 !important;
    box-shadow: none!important;
}

.preference-card h4 {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 12px 0 !important;
}

.hcgpt-personalized-chat .hcgpt-select {
    width: 100% !important;
    padding: 12px !important;
    border: 1px solid var(--hcgpt-color-border, #d1d5db) !important;
    border-radius: 8px !important;
    background-color: var(--hcgpt-color-surface, #ffffff) !important;
    color: var(--hcgpt-color-text, #111827) !important;
    font-size: 14px !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important; /* Ensure native dropdown arrow shows */
}

.hcgpt-personalized-chat .hcgpt-select:focus {
    border-color: var(--hcgpt-color-border-strong, #9ca3af) !important;
    outline: none !important;
    box-shadow: none!important;
}

.hcgpt-personalized-chat .hcgpt-select option {
    color: var(--hcgpt-color-text, #111827) !important;
    background-color: var(--hcgpt-color-surface, #ffffff) !important;
    padding: 8px !important;
}

.preferences-cta {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin-top: 30px !important;
}

#hcgpt-save-preferences {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%) !important;
    color: white !important;
    border: none !important;
    padding: 16px 32px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 24px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 280px !important;
    margin: 0 auto !important;
}

#hcgpt-save-preferences:hover {
    transform: translateY(-2px) !important;
    box-shadow: none !important;
}

#hcgpt-skip-preferences {
    background: transparent !important;
    color: #666 !important;
    border: none !important;
    padding: 10px !important;
    margin-top: 15px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    transition: color 0.2s ease !important;
}

#hcgpt-skip-preferences:hover {
    color: #4285f4 !important;
}

/* =================================================================
   CHAT INTERFACE - Clean and modern design
   ================================================================= */

.hcgpt-chat-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 500px !important;
    width: 100% !important;
    background: transparent!important;
    border-radius: none !important;
    overflow: hidden !important;
    position: relative !important;
}

.hcgpt-messages {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

.welcome-message {
    background: #f8f9fa !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    animation: fadeIn 0.5s ease-out !important;
    border-left: 4px solid #f761d4 !important;
}

.welcome-message h3 {
    color: #333 !important;
    font-size: 18px !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
}

.welcome-message p {
    color: #666 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.welcome-message.show {
    animation: slideUp 0.4s ease-out !important;
}

#hcgpt-suggestions-container {
    padding: 0 20px !important;
    margin-bottom: 16px !important;
}

.hcgpt-input-container {
    padding: 16px !important;
    border-top: 1px solid #eee !important;
    background: #fff !important;
}

.input-wrapper {
    display: flex !important;
    border: 1px solid #ddd !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    background: #f8f9fa !important;
    transition: all 0.2s ease !important;
}

.input-wrapper:focus-within {
    border-color: #4285f4 !important;
    box-shadow: none !important;
    background: #fff !important;
}

.hcgpt-user-input {
    flex: 1 !important;
    border: none !important;
    background: transparent !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    resize: none !important;
    min-height: 24px !important;
    outline: none !important;
    font-family: inherit !important;
}

.hcgpt-send-button {
    background: #a0faa9 !important;
    color: white !important;
    border: none !important;
    padding: 0 20px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.hcgpt-send-button:hover {
    background: #adffa0 !important;
    box-shadow: none!important;

}

.send-text {
    display: block !important;
}

.send-icon {
    display: none !important;
    font-size: 18px !important;
}

/* Edit preferences button */
.hcgpt-edit-preferences {
    background: transparent !important;
    color: #4285f4 !important;
    border: 1px solid #4285f4 !important;
    padding: 8px 16px !important;
    border-radius: 50px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    float: right !important;
    margin-top: -5px !important;
}

.hcgpt-edit-preferences:hover {
    background: #4285f4 !important;
    color: white !important;
}

/* Status message */
.hcgpt-status-message {
    padding: 10px 16px !important;
    background: #fff8e1 !important;
    color: #856404 !important;
    border-left: 4px solid #ffc107 !important;
    margin: 10px 20px !important;
    font-size: 14px !important;
    border-radius: 4px !important;
}

/* Responsive tweaks for chat interface */
@media (max-width: 767.98px) {
    .hcgpt-chat-container {
        min-height: 400px !important;
    }
    
    .send-text {
        display: none !important;
    }
    
    .send-icon {
        display: block !important;
    }
    
    .hcgpt-send-button {
        padding: 0 15px !important;
    }
    
    .preferences-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile - single column with buttons at bottom */
@media (max-width: 479px) {
    .preferences-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: repeat(6, auto) !important; /* 5 cards + 1 button row */
        gap: 10px !important;
        padding: 0 8px !important;
        margin: 12px 0 18px 0 !important;
    }
    
    /* Reset grid positioning for mobile - let cards stack naturally */
    .preference-card:nth-child(1) { grid-column: 1; grid-row: 1; }
    .preference-card:nth-child(2) { grid-column: 1; grid-row: 2; }
    .preference-card:nth-child(3) { grid-column: 1; grid-row: 3; }
    .preference-card:nth-child(4) { grid-column: 1; grid-row: 4; }
    .preference-card:nth-child(5) { grid-column: 1; grid-row: 5; }
    
    .preferences-cta {
        grid-column: 1 !important;
        grid-row: 6 !important; /* At the very bottom */
        align-items: center !important;
        padding: 0 8px !important;
        margin-top: 20px !important;
    }
    
    body.haircolorgpt-page .suggestion-card,
    body .haircolorgpt-chat-container .suggestion-card,
    body #page .suggestion-card,
    body div.page-wrapper .suggestion-card,
    body [class*="haircolorgpt"] .suggestion-card,
    .suggestion-card.suggestion-card.suggestion-card {
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* Force suggestions to always show as cards */
.hcgpt-suggestion {
    display: block !important;
    background: var(--hcgpt-app-bg, #f3f4f6) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 10px !important;
    border: 1px solid #e9ecef !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    color: #333 !important;
    font-size: 14px !important;
    box-shadow: none !important;
}

.hcgpt-suggestion:hover {
    background: var(--hcgpt-app-bg, #f3f4f6) !important;
    transform: translateY(-2px) !important;
    box-shadow: none !important;
    border-color: #dee2e6 !important;
}

/* ================= CUSTOM OVERRIDES (08 Jul 2025) ================ */

/* 1. Centra heading e welcome inline */
.hcgpt-welcome-section,
.hcgpt-preferences-header { text-align: center; }

/* 2. Grid preferenze: 3 colonne desktop, 2 tablet, 1 mobile */
.hcgpt-preferences-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 35px 0;
}
@media (max-width: 992px) { .hcgpt-preferences-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hcgpt-preferences-grid { grid-template-columns: 1fr; } }

/* 3. Bottoni gradient (save, new chat, CTA) */
body:not(.hcgpt-app-page) .hcgpt-save-preferences-btn,
body:not(.hcgpt-app-page) .hcgpt-new-chat-btn,
body:not(.hcgpt-app-page) .start-chatting-btn {
    background: #999;
    color: #000000 !important;
    border: none !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 24px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: none!important;
    display: inline-block !important;
    text-align: center !important;
    min-width: 200px !important;
}
body:not(.hcgpt-app-page) .hcgpt-save-preferences-btn:hover,
body:not(.hcgpt-app-page) .hcgpt-new-chat-btn:hover,
body:not(.hcgpt-app-page) .start-chatting-btn:hover {
    transform: translateY(-1px);
    box-shadow: none!important;
    background: #747474;
}

/* =================================================================
   OVERRIDE STYLES - Transparent backgrounds and no shadow
   ================================================================= */

.hcgpt-preference-card,
.preference-card,
.welcome-content,
.hcgpt-welcome-section,
.hcgpt-preference-card h3 {
    background: transparent !important;
    box-shadow: none !important;
}
