/* ==================== FOUNDATIONAL STYLES ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

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

.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: transform 0.3s ease-out;
    animation: float 20s infinite linear;
}

.shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 70%;
    right: 10%;
    animation-delay: -5s;
}

.shape:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 30%;
    right: 30%;
    animation-delay: -10s;
}

.shape:nth-child(4) {
    width: 250px;
    height: 250px;
    bottom: 20%;
    left: 20%;
    animation-delay: -15s;
}

.shape:nth-child(5) {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 50%;
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(0px) rotate(180deg); }
    75% { transform: translateY(20px) rotate(270deg); }
}

/* ==================== MAIN LAYOUT ==================== */

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* ==================== LOGO SECTION ==================== */

.logo-section {
    margin-bottom: 60px;
    animation: fadeInUp 1s ease-out;
}

.logo-container {
    margin-bottom: 42px;
}

.logo-svg {
    width: 325px;
    transition: transform 0.3s ease;
}

.logo-svg:hover {
    transform: scale(1.05) rotate(5deg);
}

.tagline {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.sub-tagline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    font-weight: 400;
}

.ai-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.ai-pulse {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ==================== SEARCH CONTAINER ==================== */

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    max-width: 600px;
    width: 100%;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

.search-box {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 24px;
    font-size: 16px;
    background: transparent;
    color: #333;
    font-family: inherit;
}

.search-box::placeholder {
    color: #666;
}

.search-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
}

.search-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.search-button svg {
    width: 20px;
    height: 20px;
}

/* ==================== SUGGESTIONS ==================== */

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 800px;
    margin-bottom: 40px;
}

.suggestion-chip {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.suggestion-chip:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* ==================== NUOVA SEZIONE: RICERCA MANUALE ==================== */

.manual-search-section {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.divider {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 300px;
    margin: 10px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.divider span {
    padding: 0 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

.manual-search-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.manual-search-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.manual-search-button:active {
    transform: translateY(-1px);
}

/* ==================== CHAT INTERFACE ==================== */

.chat-interface {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat-window {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 650px;
    height: 80vh;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 80px;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    z-index: 10;
    position: relative;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-container {
    height: calc(100% - 80px);
    display: flex;
    flex-direction: column;
}

.chat-messages {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8f9fa;
    overflow: auto;
    flex-grow: 4;
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.chat-message.user {
    flex-direction: row-reverse;
}

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

.chat-message.ai .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-left-radius: 6px;
}

.chat-message.user .message-bubble {
    background: #e9ecef;
    color: #333;
    border-bottom-right-radius: 6px;
}

.chat-input-area {
    border-top: 1px solid #e9ecef;
    background: white;
    overflow-y: scroll;
    height: auto;
    max-height: 40%;
}

/* ==================== OPTION BUTTONS ==================== */

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 14px;
    font-family: inherit;
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.option-btn:active {
    transform: translateY(0);
}

/* ==================== CORREZIONE CONTAINER OPZIONI ==================== */

.chat-input-area div[style*="flex-direction: column"] {
    display: grid !important;
    gap: 10px !important;
    grid-template-columns: 1fr 1fr !important;
    padding: 20px !important;
}

/* ==================== CORREZIONE BOTTONE CONTINUA ==================== */

.option-btn.confirm-btn {
    background: #28a745 !important;
    color: white !important;
    font-weight: 600 !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    box-shadow: 0 4px 15px rgba(40,167,69,0.3) !important;
    margin-top: 15px !important;
    padding: 15px 20px !important;
    font-size: 15px !important;
    border-radius: 30px !important;
}

.option-btn.confirm-btn:hover {
    background: #218838 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(40,167,69,0.4) !important;
}

/* ==================== SCROLLBAR PERSONALIZZATA PER OPZIONI ==================== */

.chat-input-area div[style*="flex-direction: column"]::-webkit-scrollbar {
    width: 4px;
}

.chat-input-area div[style*="flex-direction: column"]::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.chat-input-area div[style*="flex-direction: column"]::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.chat-input-area div[style*="flex-direction: column"]::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==================== ANALYSIS RESULTS ==================== */

.analysis-results {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 25px;
    border-radius: 20px;
    margin: 15px 0;
}

.analysis-results h3 {
    margin-bottom: 15px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.3rem;
}

.analysis-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.hosting-recommendation {
    text-align: center;
    margin: 20px 0;
}

.recommendation-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.recommendation-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    font-weight: 600;
    font-size: 16px;
}

.redirect-message {
    font-size: 14px;
    opacity: 0.9;
    text-align: center;
    margin-top: 15px;
}

.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

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

@media (max-width: 768px) {
    .tagline {
        font-size: 2rem;
    }
    
    .sub-tagline {
        font-size: 1rem;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .search-box {
        padding: 14px 20px;
    }
    
    .suggestion-chip {
        padding: 10px 16px;
    }
    
    .manual-search-button {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    .chat-window {
        max-width: 95vw;
        height: 90vh;
    }
    
    .chat-header {
        padding: 16px;
    }
    
    .chat-interface {
        padding: 0;
    }
    
    .main-container {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .logo-svg {
        width: 250px;
    }

    .tagline {
        font-size: 1.5rem;
    }
    
    .suggestions {
        gap: 8px;
    }
    
    .suggestion-chip {
        padding: 8px 14px;
    }
    
    .manual-search-button {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .search-box::placeholder {
        font-size: 13px;
    }
    
    .message-bubble {
        font-size: 13px;
        max-width: 85%;
    }
    
    .option-btn {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .chat-window {
        height: 100vh;
        border-radius: 0;
        max-width: none;
        margin: 0;
        min-height: auto;
    }
    
    .chat-interface {
        padding: 0;
    }
    
    .chat-header {
        padding: 12px;
    }
    
    .chat-input-area div[style*="flex-direction: column"] {
        grid-template-columns: 1fr !important;
    }
	
	.chat-container{
		height: calc(100vh - 160px);
	}	
}

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

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

.suggestion-chip {
    animation: fadeInUp 0.6s ease-out forwards;
}

.suggestion-chip:nth-child(1) { animation-delay: 0.1s; }
.suggestion-chip:nth-child(2) { animation-delay: 0.2s; }
.suggestion-chip:nth-child(3) { animation-delay: 0.3s; }
.suggestion-chip:nth-child(4) { animation-delay: 0.4s; }
.suggestion-chip:nth-child(5) { animation-delay: 0.5s; }

.manual-search-section {
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

/* ==================== UTILITY CLASSES ==================== */

.text-center {
    text-align: center;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* ==================== SCROLLBAR STYLING ==================== */

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==================== FOCUS STYLES ==================== */

.search-box:focus {
    outline: none;
}

.option-btn:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.chat-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.manual-search-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ==================== HIGH CONTRAST MODE ==================== */

@media (prefers-contrast: high) {
    .suggestion-chip {
        border: 2px solid rgba(255, 255, 255, 0.8);
    }
    
    .option-btn {
        border: 2px solid white;
    }
    
    .ai-indicator {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    .manual-search-button {
        border: 2px solid rgba(255, 255, 255, 0.8);
    }
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
    .shape {
        animation: none;
    }
    
    .ai-pulse {
        animation: none;
    }
    
    * {
        transition: none !important;
    }
    
    .suggestion-chip,
    .manual-search-section {
        animation: none !important;
    }
}








