/**
 * Animations & Keyframes
 * All custom animations for the website
 */

/* === Logo Sparkle Animation === */
@keyframes sparkle-burst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--sparkle-x)), calc(-50% + var(--sparkle-y))) scale(1);
        opacity: 0;
    }
}

.logo-sparkle {
    animation: sparkle-burst 1.5s ease-out forwards;
}

/* === Lightbox Animations === */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    animation: fade-in 0.3s ease-out;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: zoom-in 0.3s ease-out;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    transition: opacity 0.2s ease;
}

.lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    text-align: center;
    white-space: nowrap;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoom-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === Chatbot Animations === */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: var(--z-chatbot);
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ocean-medium) 0%, var(--ocean-deep) 100%);
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-ocean);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 2s ease-in-out infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-2xl);
}

.chatbot-icon {
    width: 30px;
    height: 30px;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(43, 122, 158, 0.4);
    }

    50% {
        box-shadow: 0 0 30px rgba(43, 122, 158, 0.6);
    }
}

.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition-base);
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.chatbot-header {
    background: linear-gradient(135deg, var(--ocean-medium) 0%, var(--ocean-deep) 100%);
    color: var(--white);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.chatbot-avatar {
    font-size: 2rem;
}

.chatbot-title h4 {
    margin: 0;
    font-size: var(--text-lg);
    color: var(--white);
}

.chatbot-status {
    font-size: var(--text-sm);
    opacity: 0.9;
}

.chatbot-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: background var(--transition-fast);
}

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.chatbot-message {
    display: flex;
    gap: var(--space-2);
    animation: message-slide-in 0.3s ease-out;
}

@keyframes message-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-text {
    background: var(--white);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

.user-message .message-text {
    background: var(--ocean-light);
    color: var(--white);
}

.message-time {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: var(--space-1);
    padding-left: var(--space-2);
}

.typing-indicator {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: var(--space-3);
    background: var(--white);
    border-radius: var(--radius-lg);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--ocean-medium);
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

.chatbot-input-container {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}

.chatbot-input {
    flex: 1;
    padding: var(--space-3);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-family: var(--font-body);
    transition: border-color var(--transition-fast);
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--ocean-medium);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    background: var(--ocean-medium);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-send:hover {
    background: var(--ocean-deep);
    transform: scale(1.05);
}

.chatbot-suggestions {
    padding: var(--space-3) var(--space-4);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.suggestion-chip {
    padding: var(--space-2) var(--space-3);
    background: var(--sand-light);
    border: 1px solid var(--sand-medium);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: var(--sand-medium);
    transform: translateY(-2px);
}

/* === Floating Animation === */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* === Fade In Up Animation === */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Shimmer Effect === */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* === Responsive Chatbot === */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 90px;
    }

    .chatbot-toggle {
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: 100vw;
        height: calc(100vh - 100px);
        right: 0;
        bottom: 80px;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .chatbot-suggestions {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}