/* ============================================ */
/* ENHANCED GIGGLE BOT - CONVERSATIONAL AI STYLES */
/* ============================================ */

/* ============================================ */
/* IMPORTS & BASE STYLES */
/* ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&family=Pacifico&family=Dancing+Script:wght@700&display=swap');

:root {
    --primary-color: #ff6b8b;
    --secondary-color: #667eea;
    --accent-color: #764ba2;
    --text-light: #2d3436;
    --text-dark: #ffffff;
    --bg-gradient-start: #ffeaa7;
    --bg-gradient-end: #dfe6e9;
    --message-user: #00b894;
    --message-bot: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --typing-indicator: #667eea;
    --success-green: #00b894;
    --warning-yellow: #fdcb6e;
    --error-red: #d63031;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* ============================================ */
/* ENHANCED CONTAINER */
/* ============================================ */
.container {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================ */
/* ENHANCED CHAT HEADER */
/* ============================================ */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.bot-avatar {
    width: 70px;
    height: 70px;
    background: var(--text-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.header-text h1 {
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
    font-family: 'Pacifico', cursive;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header-text p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 600;
}

.sound-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
    font-size: 18px;
}

.sound-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.ai-status {
    position: absolute;
    top: 15px;
    right: 70px;
    background: rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: pulse-glow 2s ease infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }
}

/* ============================================ */
/* ENHANCED CHAT AREA */
/* ============================================ */
.chat-area {
    height: 450px;
    overflow-y: auto;
    padding: 30px 25px;
    scroll-behavior: smooth;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98), rgba(240, 240, 240, 0.95));
}

.chat-area::-webkit-scrollbar {
    width: 8px;
}

.chat-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.chat-area::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

.message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
    gap: 15px;
    position: relative;
    animation: messageSlideIn 0.4s ease;
}

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

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

.user-message .avatar {
    background: linear-gradient(135deg, var(--message-user), #00cec9);
}

.bot-message .avatar {
    background: var(--message-bot);
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.bubble {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 25px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.user-message .bubble {
    background: linear-gradient(135deg, var(--message-user), #00cec9);
    color: white;
    border-bottom-right-radius: 8px;
}

.bot-message .bubble {
    background: white;
    color: var(--text-light);
    border-bottom-left-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.emoji {
    font-size: 18px;
    margin-left: 8px;
    opacity: 0.8;
}

.welcome-text {
    font-weight: 700;
    font-size: 18px;
    color: var(--secondary-color);
    font-family: 'Dancing Script', cursive;
}

/* ============================================ */
/* CONVERSATION INDICATORS */
/* ============================================ */
.conversation-indicator {
    position: absolute;
    top: -30px;
    right: 15px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    animation: indicator-float 3s ease infinite;
}

@keyframes indicator-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.memory-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: var(--success-green);
    color: white;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 700;
    animation: slideUp 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
}

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

/* ============================================ */
/* ENHANCED TYPING INDICATOR */
/* ============================================ */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: white;
    border-radius: 25px;
    border-bottom-left-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-left: 60px;
    max-width: 70%;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.typing-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--typing-indicator);
    animation: typing-bounce 1.4s ease-in-out infinite;
}

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

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

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.typing-text {
    color: var(--typing-indicator);
    font-weight: 700;
    font-size: 14px;
}

/* ============================================ */
/* ENHANCED QUICK ACTIONS */
/* ============================================ */
.quick-actions {
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    color: white;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 107, 139, 0.3);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.4);
}

.action-btn:active {
    transform: translateY(-1px);
}

.action-btn i {
    font-size: 16px;
}

/* ============================================ */
/* ENHANCED INPUT AREA */
/* ============================================ */
.input-area {
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
}

.enhanced-input-area {
    position: relative;
}

.context-menu {
    position: absolute;
    bottom: 70px;
    left: 15px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    min-width: 200px;
    animation: contextMenuPop 0.3s ease;
}

@keyframes contextMenuPop {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.context-suggestion {
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.context-suggestion:last-child {
    margin-bottom: 0;
}

.context-suggestion:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateX(5px);
}

.context-suggestion i {
    font-size: 16px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

#userInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 25px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s ease;
    background: #f8f9fa;
    outline: none;
}

#userInput:focus {
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 107, 139, 0.3);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 107, 139, 0.4);
}

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

.hint {
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
    opacity: 0.8;
    font-weight: 600;
    line-height: 1.4;
}

.hint strong {
    color: var(--secondary-color);
}

.hint button {
    transition: all 0.3s ease;
}

.hint button:hover {
    transform: scale(1.05);
}

/* ============================================ */
/* ENHANCED BACKGROUND ANIMATIONS */
/* ============================================ */
.floating-hearts {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

.heart {
    position: absolute;
    font-size: 20px;
    animation: float-heart 15s linear infinite;
    opacity: 0.3;
}

.heart:nth-child(1) { left: 10%; animation-delay: 0s; }
.heart:nth-child(2) { left: 30%; animation-delay: 5s; }
.heart:nth-child(3) { left: 60%; animation-delay: 10s; }
.heart:nth-child(4) { left: 80%; animation-delay: 15s; }

@keyframes float-heart {
    0% {
        bottom: -50px;
        transform: translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        bottom: 100%;
        transform: translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

.sparkle {
    position: fixed;
    font-size: 25px;
    animation: sparkle-float 8s linear infinite;
    opacity: 0.6;
    pointer-events: none;
    z-index: -1;
}

.s1 { left: 5%; top: 20%; animation-delay: 0s; }
.s2 { left: 85%; top: 60%; animation-delay: 3s; }
.s3 { left: 45%; top: 80%; animation-delay: 6s; }

@keyframes sparkle-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-50px) rotate(180deg);
        opacity: 0;
    }
}

/* ============================================ */
/* ENHANCED FOOTER */
/* ============================================ */
.dev-footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
    text-align: center;
    color: white;
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.footer-heart {
    font-size: 24px;
    animation: heartbeat 1.5s ease infinite;
}

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

.footer-text {
    font-size: 16px;
    font-weight: 600;
}

.crafted, .by {
    opacity: 0.9;
}

.love, .name {
    font-weight: 800;
    color: #ffeaa7;
}

.footer-icons {
    display: flex;
    gap: 12px;
    font-size: 18px;
    opacity: 0.9;
}

.footer-extra {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 8px;
}

.sparkle-extra {
    color: #ffeaa7;
    animation: sparkle-twinkle 2s ease infinite;
}

.sparkle-extra:nth-child(2) {
    animation-delay: 1s;
}

@keyframes sparkle-twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        margin: 10px;
        border-radius: 20px;
    }
    
    .chat-header {
        padding: 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-text h1 {
        font-size: 22px;
    }
    
    .bot-avatar {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .chat-area {
        height: 400px;
        padding: 20px 15px;
    }
    
    .bubble {
        max-width: 85%;
        font-size: 14px;
    }
    
    .quick-actions {
        padding: 15px;
        gap: 8px;
    }
    
    .action-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .input-area {
        padding: 20px 15px;
    }
    
    .context-menu {
        left: 10px;
        right: 10px;
        min-width: auto;
    }
    
    .hint {
        font-size: 12px;
    }
    
    .ai-status {
        display: none;
    }
}

@media (max-width: 480px) {
    .chat-area {
        height: 350px;
    }
    
    .bubble {
        max-width: 90%;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .action-btn {
        justify-content: center;
    }
    
    .conversation-indicator {
        display: none;
    }
}

/* ============================================ */
/* DARK MODE SUPPORT */
/* ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-gradient-start: #2d3748;
        --bg-gradient-end: #1a202c;
        --text-light: #e2e8f0;
        --text-dark: #1a202c;
    }
    
    body {
        background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    }
    
    .container {
        background: rgba(45, 55, 72, 0.95);
    }
    
    .bot-message .bubble {
        background: rgba(26, 32, 44, 0.9);
        color: var(--text-light);
        border: 1px solid rgba(102, 126, 234, 0.3);
    }
    
    #userInput {
        background: rgba(26, 32, 44, 0.8);
        color: var(--text-light);
        border-color: rgba(102, 126, 234, 0.4);
    }
    
    .context-menu {
        background: rgba(26, 32, 44, 0.95);
        border-color: var(--primary-color);
    }
    
    .context-suggestion {
        color: var(--text-light);
    }
}