/* Modern Apple-Style AI Consultant */

/* Confirmation Modal with Brand Colors */
.ai-consultation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(42, 92, 130, 0.85), rgba(97, 176, 176, 0.85));
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ai-consultation-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirmation-modal, .service-selection-modal {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 255, 247, 0.95));
    backdrop-filter: blur(40px);
    border-radius: 32px;
    padding: 56px 48px;
    max-width: 480px;
    text-align: center;
    transform: scale(0.7) translateY(60px) rotateX(15deg);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 
        0 40px 80px rgba(42, 92, 130, 0.2),
        0 20px 40px rgba(97, 176, 176, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
}

/* Service selection modal styles removed - now using in-chat buttons */

.confirmation-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 102, 0.3), transparent);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.ai-consultation-overlay.active .confirmation-modal {
    transform: scale(1) translateY(0) rotateX(0);
}

.confirmation-modal h3 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue), var(--teal-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 20px 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
    position: relative;
}

.confirmation-modal h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--yellow-accent), var(--coral-accent));
    border-radius: 2px;
    animation: expandLine 0.8s ease-out 0.3s both;
}

@keyframes expandLine {
    from { width: 0; }
    to { width: 60px; }
}

.confirmation-modal p {
    font-size: 18px;
    color: var(--dark-charcoal);
    margin: 0 0 40px 0;
    line-height: 1.5;
    font-weight: 400;
    opacity: 0.85;
}

.confirmation-buttons {
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.btn-confirm, .btn-cancel {
    padding: 16px 40px;
    border-radius: 20px;
    border: none;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.btn-confirm {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: #1F2937;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.btn-confirm::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-confirm:hover::before {
    left: 100%;
}

.btn-confirm:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.4);
}

.btn-cancel {
    background: linear-gradient(135deg, #EF4444, #F87171);
    color: white;
    border: none;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #DC2626, #EF4444);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.4);
}

/* Full-Screen Chat Interface */
.ai-chat-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111827;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ai-chat-fullscreen.active {
    transform: translateY(0);
}

/* Chat Header */
.chat-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

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

.chat-title h2 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

.ai-status-indicator {
    width: 8px;
    height: 8px;
    background: #30D158;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Close Button */
.chat-close-btn {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(20px);
}

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

.chat-close-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
    stroke-width: 2;
}

/* Chat Content */
.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 32px;
    height: calc(100vh - 100px); /* Fixed height */
}

.chat-messages-modern {
    flex: 1;
    padding: 40px 0 20px 0;
    overflow-y: auto;
    scroll-behavior: smooth;
    min-height: 0; /* Allow flexbox to shrink */
}

/* Messages */
.message-modern {
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInMessage 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

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

.message-ai {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

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

.ai-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    animation: aiPulse 3s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.ai-avatar svg {
    width: 28px;
    height: 28px;
    fill: url(#aiGradient);
    filter: drop-shadow(0 2px 8px rgba(42, 92, 130, 0.4));
    animation: aiIconGlow 2s ease-in-out infinite alternate;
}

@keyframes aiIconGlow {
    from { filter: drop-shadow(0 2px 8px rgba(42, 92, 130, 0.4)); }
    to { filter: drop-shadow(0 4px 16px rgba(97, 176, 176, 0.6)); }
}

.message-bubble {
    max-width: 70%;
    padding: 20px 24px;
    border-radius: 24px;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 400;
}

.message-ai .message-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-bottom-left-radius: 8px;
}

.message-user .message-bubble {
    background: var(--primary-blue);
    color: white;
    border-bottom-right-radius: 8px;
}

/* Highlight yellow text */
.highlight-text {
    color: #FFD60A;
    font-weight: 500;
}

/* Typing Animation */
.typing-animation {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.typing-dots-modern {
    display: flex;
    gap: 6px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-modern {
    padding: 24px 0 32px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0; /* Never shrink the input area */
    position: sticky;
    bottom: 0;
    background: #111827;
}

.input-container-modern {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 16px 20px;
    backdrop-filter: blur(20px);
}

.input-field-modern {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 24px;
}

.input-field-modern::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.send-btn-modern {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--yellow-accent), #FFA726);
    border: none;
    border-radius: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(255, 215, 102, 0.4);
}

.send-btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.send-btn-modern:hover::before {
    left: 100%;
}

.send-btn-modern:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 24px rgba(255, 215, 102, 0.5);
}

.send-btn-modern:active {
    transform: scale(0.95);
}

.send-btn-modern:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-btn-modern:disabled::before {
    display: none;
}

.send-btn-modern svg {
    width: 18px;
    height: 18px;
    fill: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.send-btn-modern:hover svg {
    transform: translateX(2px);
}

/* Progress Indicator */
.progress-modern {
    padding: 20px 0;
    text-align: center;
}

.progress-text-modern {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 12px;
}

.progress-bar-modern {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-fill-modern {
    height: 100%;
    background: linear-gradient(90deg, #007AFF, #5856D6);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 0%;
}

/* Contact Ready State */
.contact-ready-modern {
    text-align: center;
    padding: 40px 24px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 24px;
    margin: 20px 0;
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.contact-ready-modern h3 {
    color: #FFD60A;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.contact-ready-modern p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.contact-btn-modern {
    background: linear-gradient(135deg, #FFD60A, #FF9500);
    color: #000;
    border: none;
    padding: 16px 32px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.contact-btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 214, 10, 0.3);
}

/* Pulse animation for confirmation button */
.pulse-animation {
    animation: confirmPulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.pulse-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmerConfirm 3s infinite;
}

@keyframes confirmPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(255, 214, 10, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 8px 24px rgba(255, 214, 10, 0.6);
    }
}

@keyframes shimmerConfirm {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Duration Selection Buttons in Chat */
.duration-buttons-container {
    margin: 20px 0;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInMessage 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.duration-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 500px;
}

.duration-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.duration-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.duration-btn:hover::before {
    left: 100%;
}

.duration-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 215, 102, 0.6);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.duration-icon {
    font-size: 28px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.duration-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.duration-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--yellow-accent);
}

.duration-desc {
    font-size: 13px;
    opacity: 0.8;
    font-weight: 400;
}

/* Service Selection Buttons in Chat */
.service-buttons-container {
    margin: 20px 0;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInMessage 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

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

.service-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px 20px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    backdrop-filter: blur(10px);
}

.service-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.service-btn.other-btn {
    border: 1px dashed rgba(255, 215, 102, 0.4);
    background: rgba(255, 215, 102, 0.1);
}

.service-btn.other-btn:hover {
    background: rgba(255, 215, 102, 0.15);
    border-color: rgba(255, 215, 102, 0.6);
}

/* Thinking Loader Animation */
.thinking-loader-container {
    margin: 20px 0;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInMessage 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.thinking-loader {
    background: rgba(42, 92, 130, 0.1);
    border: 1px solid rgba(42, 92, 130, 0.2);
    border-radius: 20px;
    padding: 20px 24px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 350px;
}

.thinking-brain {
    font-size: 24px;
    animation: thinkingPulse 2s ease-in-out infinite;
}

@keyframes thinkingPulse {
    0%, 100% { 
        transform: scale(1);
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.1);
        filter: brightness(1.3);
    }
}

.thinking-text {
    color: var(--primary-blue);
    font-weight: 500;
    font-size: 15px;
}

.thinking-dots {
    display: inline-flex;
    gap: 4px;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    background: var(--teal-green);
    border-radius: 50%;
    animation: thinkingDots 1.4s ease-in-out infinite both;
}

.thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-dot:nth-child(2) { animation-delay: -0.16s; }
.thinking-dot:nth-child(3) { animation-delay: 0s; }

@keyframes thinkingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.thinking-progress {
    width: 100%;
    height: 3px;
    background: rgba(42, 92, 130, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 12px;
}

.thinking-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--teal-green), var(--yellow-accent));
    border-radius: 2px;
    width: 0%;
    animation: thinkingProgress var(--thinking-duration, 6s) linear forwards;
}

@keyframes thinkingProgress {
    0% { width: 0%; }
    20% { width: 30%; }
    60% { width: 70%; }
    100% { width: 100%; }
}

/* Typing Cursor Animation */
.typing-cursor {
    color: var(--yellow-accent);
    font-weight: 400;
    animation: blink 1s infinite;
    display: inline-block;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Enhanced message bubble animations */
.message-bubble {
    position: relative;
    overflow: hidden;
}

.message-ai .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 102, 0.1), transparent);
    animation: messageShimmer 3s infinite;
    pointer-events: none;
}

@keyframes messageShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Remove the circular background effect since AI icon is now just the symbol */

/* Smooth scroll enhancement */
.chat-messages-modern {
    scroll-behavior: smooth;
}

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

.chat-messages-modern::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.chat-messages-modern::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--coral-accent), var(--yellow-accent));
    border-radius: 3px;
}

.chat-messages-modern::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--yellow-accent), var(--coral-accent));
}

/* Responsive */
@media (max-width: 768px) {
    .chat-content {
        padding: 0 20px;
    }
    
    .chat-header-modern {
        padding: 20px 20px;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .confirmation-modal {
        margin: 20px;
        padding: 36px 28px;
        max-width: none;
    }
    
    /* Service buttons in chat - mobile */
    .service-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .service-btn {
        padding: 14px 16px;
        font-size: 13px;
    }
}