/* ==========================================================================
   LegalPal - Main Stylesheet
   ========================================================================== */

/* Hero & Backgrounds */
/* Hero & Backgrounds */
.hero-background,
.hero-bg-default {
    background-image: url('https://imagedelivery.net/91g5n0eh9LtASHQiifhuEQ/b14cb835-bce7-4d83-f2f3-91e3f6c75400/public');
    background-size: cover;
    background-position: center;
}

@media (orientation: portrait) {
    .hero-background,
    .hero-bg-default {
        background-image: url('https://imagedelivery.net/91g5n0eh9LtASHQiifhuEQ/0a9c1bc1-93f1-4691-5a43-446185ab9700/public');
    }
}

.hero-bg-clients {
    background-image: url('https://imagedelivery.net/91g5n0eh9LtASHQiifhuEQ/be251cef-cce1-44c6-550d-89973d4c1f00/public');
    background-size: cover;
    background-position: center;
}

.hero-bg-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}


.hero-background.is-client {
    background-image: url('https://imagedelivery.net/91g5n0eh9LtASHQiifhuEQ/be251cef-cce1-44c6-550d-89973d4c1f00/public');
}

@media (orientation: portrait) {
    .hero-background {
        background-image: url('https://imagedelivery.net/91g5n0eh9LtASHQiifhuEQ/0a9c1bc1-93f1-4691-5a43-446185ab9700/public');
    }

    .hero-background.is-client {
        background-image: url('https://imagedelivery.net/91g5n0eh9LtASHQiifhuEQ/be251cef-cce1-44c6-550d-89973d4c1f00/public');
    }
}

/* Scrollbars */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-visible::-webkit-scrollbar {
    display: none;
    height: 10px;
}

.scrollbar-visible:hover::-webkit-scrollbar,
.scrollbar-visible.dragging::-webkit-scrollbar {
    display: block;
    height: 10px;
}

.scrollbar-visible:hover::-webkit-scrollbar-track,
.scrollbar-visible.dragging::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
}

.scrollbar-visible:hover::-webkit-scrollbar-thumb,
.scrollbar-visible.dragging::-webkit-scrollbar-thumb {
    background: rgba(0, 154, 228, 0.6);
    border-radius: 9999px;
}

.scrollbar-visible {
    scrollbar-width: none;
    scrollbar-color: rgba(0, 154, 228, 0.6) rgba(255, 255, 255, 0.08);
}

.scrollbar-visible:hover,
.scrollbar-visible.dragging {
    scrollbar-width: auto;
    scrollbar-color: rgba(0, 154, 228, 0.6) rgba(255, 255, 255, 0.08);
}

/* Header & Glassmorphism */
header {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-logo .cls-1 {
    fill: #ffffff;
    transition: fill 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.header-scrolled .header-logo .cls-1 {
    fill: #173124; /* primary color */
}

header.header-scrolled {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

header.header-scrolled nav a {
    color: #424844;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

#back-to-top:hover {
    transform: translateX(-50%) scale(1.1);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

#back-to-top:focus {
    outline: 2px solid #009ae4;
    outline-offset: 2px;
}

/* Animations */
@keyframes appleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.apple-fade-in {
    animation: appleFadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

@keyframes fadeInFromRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-from-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-from-right.animate {
    opacity: 1;
    transform: translateX(0);
}

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

.fade-in-up {
    opacity: 0;
}

.fade-in-up.animate {
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

body.menu-open {
    overflow: hidden;
}

/* Product Details Modal */
#product-details-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

#product-details-menu.visible {
    transform: translateY(0);
}

/* Fullscreen Chat Animation */
@keyframes expand-fullscreen {
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes collapse-fullscreen {
    from {
        clip-path: inset(0 0 0 0);
    }
    to {
        clip-path: inset(45% 0 45% 0);
    }
}

/* Aurora Ambient Background */
.aurora-bg {
    background-color: #06130d;
    background-image:
        radial-gradient(ellipse 100% 70% at 50% -20%, rgba(74, 222, 128, 0.4), transparent 70%),
        radial-gradient(ellipse 80% 50% at 20% 30%, rgba(16, 185, 129, 0.3), transparent 60%),
        radial-gradient(ellipse 70% 60% at 85% 25%, rgba(0, 154, 228, 0.25), transparent 65%),
        radial-gradient(ellipse 60% 40% at 50% 60%, rgba(34, 197, 94, 0.15), transparent 50%),
        linear-gradient(180deg, #071710 0%, #05100b 100%);
    position: relative;
}

.aurora-ribbon {
    position: absolute;
    inset: -40%;
    pointer-events: none;
    background: radial-gradient(ellipse 70% 35% at 50% 40%, rgba(74, 222, 128, 0.25) 0%, rgba(16, 185, 129, 0.18) 35%, rgba(5, 150, 105, 0.08) 55%, transparent 75%);
    filter: blur(50px);
    opacity: 0.9;
    transform-origin: center;
    animation: auroraFloat 16s ease-in-out infinite alternate;
}

.aurora-ribbon-secondary {
    position: absolute;
    inset: -30%;
    pointer-events: none;
    background: radial-gradient(ellipse 60% 25% at 40% 30%, rgba(52, 211, 153, 0.28) 0%, rgba(0, 168, 232, 0.15) 40%, transparent 70%);
    filter: blur(40px);
    opacity: 0.8;
    animation: auroraFloat 20s ease-in-out infinite alternate-reverse;
}

@keyframes auroraFloat {
    0% {
        transform: rotate(0deg) scale(1) translate(0, 0);
    }
    50% {
        transform: rotate(3deg) scale(1.08) translate(-2%, 3%);
    }
    100% {
        transform: rotate(-2deg) scale(0.95) translate(3%, -2%);
    }
}

/* AI Chat Prompt & Fullscreen States */
#ai-chat-prompt.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 100;
    background-color: #06130d;
    background-image:
        radial-gradient(ellipse 100% 70% at 50% -20%, rgba(74, 222, 128, 0.4), transparent 70%),
        radial-gradient(ellipse 80% 50% at 20% 30%, rgba(16, 185, 129, 0.3), transparent 60%),
        radial-gradient(ellipse 70% 60% at 85% 25%, rgba(0, 154, 228, 0.25), transparent 65%),
        linear-gradient(180deg, #071710 0%, #05100b 100%);
    padding: 1.5rem;
    clip-path: inset(45% 0 45% 0);
    animation: expand-fullscreen 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    color: #ffffff;
}

#ai-chat-prompt.is-fullscreen.collapsing {
    animation: collapse-fullscreen 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

#fullscreen-chat-header {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    transition-delay: 0.4s;
}

#ai-chat-prompt.is-fullscreen #fullscreen-chat-header {
    display: flex;
    opacity: 1;
}

#ai-chat-prompt.is-fullscreen .max-w-2xl {
    max-width: 48rem; /* 768px */
}

#ai-chat-title {
    transition: opacity 0.3s ease-out, max-height 0.5s ease-out, margin 0.5s ease-out, transform 0.5s ease-out;
    overflow: hidden;
}

#ai-chat-title.hidden {
    opacity: 0;
    max-height: 0px !important;
    margin-bottom: 0px !important;
    transform: scale(0.9);
}

#ai-chat-prompt.is-fullscreen #ai-chat-hero-content {
    display: none !important;
}

#ai-chat-prompt:not(.is-fullscreen) #ai-chat-messages {
    display: none !important;
}

#ai-chat-resume-content {
    display: none;
}

#ai-chat-prompt.has-active-chat:not(.is-fullscreen) #ai-chat-hero-content {
    display: none !important;
}

#ai-chat-prompt.has-active-chat:not(.is-fullscreen) #ai-chat-resume-content {
    display: flex !important;
}

#ai-chat-prompt.is-fullscreen #ai-chat-resume-content {
    display: none !important;
}

/* Speech Bubble */
.speech-bubble {
    position: relative;
    border-radius: 1.5rem 1.5rem 1.5rem 0.25rem;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 28px;
    border-width: 8px 8px 0 0;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}

/* Scenario Carousel */
.scenario-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.scenario-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.carousel-dot {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dot.active {
    width: 2rem !important;
    background-color: #173124 !important;
}

/* Message Bubbles */
.user-message-bubble {
    display: flex;
    justify-content: flex-end;
}

.user-message-bubble > div {
    background-color: #006591; /* secondary */
    color: #ffffff; /* on-secondary */
    padding: 0.75rem 1.25rem;
    border-radius: 1.5rem 1.5rem 0.25rem 1.5rem;
    max-width: 80%;
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
    animation-delay: 0.2s;
}

.assistant-message-bubble {
    display: flex;
    justify-content: flex-start;
}

.assistant-message-bubble > div {
    background-color: #ffffff;
    color: #191c1d;
    border: 1px solid rgba(194, 200, 194, 0.5);
    padding: 0.75rem 1.25rem;
    border-radius: 1.5rem 1.5rem 1.5rem 0.25rem;
    max-width: 80%;
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
    animation-delay: 0.1s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Content Toggles */
#lawyer-content {
    transition: opacity 0.5s ease-in-out, max-height 0.8s ease-in-out;
    max-height: 10000px;
    overflow: hidden;
}

#lawyer-content.hidden {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
}

#client-content {
    transition: opacity 0.5s ease-in-out, max-height 0.8s ease-in-out;
    max-height: 10000px;
    overflow: hidden;
}

#client-content.hidden {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
}
