/* Custom styles for life insurance chat application */

/* Enhanced root variables for better theming */
:root {
    --primary-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --secondary-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --success-gradient: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    --accent-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    --dark-bg: #1a1a1a;
    --card-bg: #2d2d2d;
    --message-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --border-radius-lg: 1.5rem;
    --primary-color: #11998e;
    --accent-color: #38ef7d;
    
    /* Bootstrap overrides to ensure green theme */
    --bs-primary: #11998e;
    --bs-primary-rgb: 17, 153, 142;
    --bs-secondary: #38ef7d;
    --bs-secondary-rgb: 56, 239, 125;
    --bs-success: #56ab2f;
    --bs-success-rgb: 86, 171, 47;
    --bs-info: #38ef7d;
    --bs-info-rgb: 56, 239, 125;
}

/* Enhanced body and background */
body {
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 50%, #2d2d2d 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Enhanced header styling */
header {
    background: rgba(45, 45, 45, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

header h1 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced card styling */
.card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Enhanced chat messages */
.chat-message {
    margin-bottom: 1.5rem;
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
}

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

.chat-message.user {
    margin-left: auto;
}

.chat-message.assistant {
    margin-right: auto;
}

.message-bubble {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-lg);
    position: relative;
    box-shadow: var(--message-shadow);
    backdrop-filter: blur(10px);
}

.message-bubble.user {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 0.5rem;
    margin-left: auto;
}

.message-bubble.assistant {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom-left-radius: 0.5rem;
    color: #ffffff;
    font-weight: 500;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Enhanced progress badges */
.progress-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.progress-badge.collected {
    background: var(--success-gradient);
    color: white;
    transform: scale(1);
}

.progress-badge.missing {
    background: rgba(255, 255, 255, 0.15);
    color: #cccccc;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

.progress-badge:hover {
    transform: scale(1.05);
}

/* Enhanced input styling */
#chat-input {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#chat-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(17, 153, 142, 0.3);
    outline: none;
    transform: translateY(-1px);
}

#chat-input::placeholder {
    color: #cccccc;
    font-style: italic;
    font-weight: 400;
}

#chat-input:disabled {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #666;
}

/* Enhanced send button */
#send-btn {
    background: var(--primary-gradient);
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

#send-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.6);
}

#send-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #666;
    box-shadow: none;
}

/* Typing indicator animation */
@keyframes typing {
    0%, 60%, 100% {
        transform: initial;
    }
    30% {
        transform: translateY(-10px);
    }
}

.typing-dots {
    display: inline-block;
}

.typing-dots span {
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out;
    animation-fill-mode: both;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Enhanced buttons */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.4);
}

.btn-outline-secondary {
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

/* Chat messages scroll */
#chat-messages {
    scroll-behavior: smooth;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chat-message {
        max-width: 95%;
    }
    
    .message-bubble {
        padding: 0.5rem 0.75rem;
    }
    
    #welcome-section {
        margin-bottom: 1rem;
    }
}

/* Enhanced success section */
.success-section {
    background: var(--success-gradient);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    text-align: center;
    animation: successFadeIn 0.6s ease-out;
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Enhanced welcome section */
.welcome-features {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.welcome-features ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-features ul li:last-child {
    border-bottom: none;
}

/* Enhanced icon styling */
.fa-shield-alt, .fa-comments, .fa-robot {
    filter: drop-shadow(0 2px 4px rgba(17, 153, 142, 0.3));
}

/* Completion page button hover effect */
#new-quote-btn:hover {
    background: linear-gradient(135deg, #38ef7d 0%, #56ab2f 100%) !important;
    border-color: rgba(86, 171, 47, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(17, 153, 142, 0.4) !important;
}

/* Force Bootstrap primary/secondary colors to use our green theme */
.btn-primary, .bg-primary, .text-primary {
    background: var(--primary-gradient) !important;
    border-color: #11998e !important;
    color: white !important;
}

.btn-secondary, .bg-secondary, .text-secondary {
    background: #38ef7d !important;
    border-color: #38ef7d !important;
    color: white !important;
}

.text-info {
    color: #38ef7d !important;
}

/* Ensure all icons follow green theme */
.fas, .fa {
    color: inherit;
}

/* Override any remaining blue Bootstrap defaults */
.text-primary {
    color: #11998e !important;
}

/* Force the new quote button to be green - override any Bootstrap conflicts */
#new-quote-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    border: 2px solid rgba(56, 239, 125, 0.3) !important;
    color: white !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 12px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3) !important;
}

#new-quote-btn:hover, #new-quote-btn:focus, #new-quote-btn:active {
    background: linear-gradient(135deg, #38ef7d 0%, #56ab2f 100%) !important;
    border-color: rgba(86, 171, 47, 0.5) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 25px rgba(17, 153, 142, 0.4) !important;
}

/* Informational tag styling - not clickable */
.info-tag {
    background: rgba(17, 153, 142, 0.1);
    border: 1px solid rgba(17, 153, 142, 0.3);
    color: #38ef7d;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    cursor: default;
    backdrop-filter: blur(5px);
}

.info-tag i {
    color: #11998e;
    opacity: 0.8;
}

/* Chat messages scroll enhancement */
#chat-messages {
    scroll-behavior: smooth;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
}

/* Enhanced badge styling */
.badge {
    background: var(--success-gradient) !important;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* Additional visual enhancements */
.card-header {
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
}

/* Animated background elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(17, 153, 142, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(56, 239, 125, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(86, 171, 47, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

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

/* Enhanced typing animation */
.typing-dots span {
    animation: typingPulse 1.4s infinite ease-in-out;
}

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

/* Hover effects for feature list */
.welcome-features ul li:hover {
    background: rgba(17, 153, 142, 0.1);
    border-radius: 10px;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

/* Enhanced progress section */
#progress-section {
    background: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Success animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Custom scrollbar for chat */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: var(--bs-light);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--bs-dark);
}
