:root {
    font-family: 'Inter', sans-serif;
}

body,
html {
    scroll-behavior: smooth !important;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

.nycd {
    font-family: 'Nothing You Could Do', cursive;
}

/* Fix container overflow */
section {
    overflow-x: hidden;
    width: 100%;
}

/* Chatbot Styles */
#chatbot-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

#chatbot-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.6);
}

#chatbot-icon i {
    font-size: 28px;
    color: white;
}

#chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    animation: slideUp 0.3s ease;
}

#chatbot-container.active {
    display: flex;
}

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

.chat-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fafb;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.chat-message.bot {
    justify-content: flex-start;
}

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

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.chat-message.bot .message-bubble {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-container {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #3b82f6;
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-send-btn:hover {
    transform: scale(1.1);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Work Items Styles */
.work-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: rgb(228, 228, 231);
    height: 400px;
    transition: all 0.5s ease;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    grid-column: span 12;
}

.work-item:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: 1rem;
}

.work-item-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.work-item:hover .work-item-bg {
    transform: scale(1.1);
}

.work-item-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.work-item:hover .work-item-overlay {
    opacity: 1;
}

.work-item-title {
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    transform: translateY(1rem);
    transition: transform 0.3s ease;
}

.work-item:hover .work-item-title {
    transform: translateY(0);
}

.work-item-description {
    color: rgb(212, 212, 216);
    font-size: 0.875rem;
    transform: translateY(1rem);
    transition: transform 0.3s ease;
    transition-delay: 75ms;
}

.work-item:hover .work-item-description {
    transform: translateY(0);
}

/* Work item size variants */
@media (min-width: 768px) {
    .work-item {
        grid-column: span 4;
    }
    
    .work-item-large {
        grid-column: span 8;
    }
    
    .work-item-medium {
        grid-column: span 6;
    }
}

/* Animation delay for pulse */
.animation-delay-1s {
    animation-delay: 1s;
}

/* Mobile Responsiveness Fixes */
@media (max-width: 768px) {
    /* Remove lateral padding that causes white borders */
    body {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Fix container widths */
    .max-w-screen-xl {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Fix header */
    header {
        width: 100%;
        left: 0;
        right: 0;
    }

    header > div {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Fix hero section */
    section {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Fix text sizes for mobile */
    h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 2rem !important;
        line-height: 1.3 !important;
    }

    h3 {
        font-size: 1.5rem !important;
    }

    /* Fix stats grid */
    .grid.grid-cols-2 {
        gap: 1rem !important;
    }

    /* Fix feature cards */
    .group.p-8 {
        padding: 1.5rem !important;
    }

    /* Fix buttons */
    .px-8 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    /* Fix work items */
    .work-item {
        height: 300px;
        margin-bottom: 1rem;
    }

    .work-item-overlay {
        padding: 1.5rem;
    }

    .work-item-title {
        font-size: 1.1rem;
    }

    .work-item-description {
        font-size: 0.8rem;
    }

    /* Fix partner logos */
    .grid.grid-cols-8 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }

    .grid.grid-cols-8 li {
        grid-column: span 1 !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .grid.grid-cols-8 img {
        max-width: 100px !important;
    }

    /* Fix chatbot */
    #chatbot-icon {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    #chatbot-icon i {
        font-size: 24px;
    }

    #chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 80px;
        left: 10px;
        margin: 0 auto;
    }

    /* Fix form inputs */
    input, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Fix overflow on sections */
    .overflow-hidden {
        overflow-x: hidden !important;
    }

    /* Fix image containers */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Fix gradient container */
    #container {
        width: 100vw;
        left: 0;
        right: 0;
    }

    /* Fix py padding */
    .py-32 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    /* Fix gap between elements */
    .gap-8 {
        gap: 1.5rem !important;
    }

    .gap-12 {
        gap: 2rem !important;
    }

    /* Fix footer */
    footer .grid {
        gap: 2rem !important;
    }

    /* Fix demo visual section */
    .bg-gradient-to-br.from-blue-50 {
        padding: 1.5rem !important;
    }

    /* Fix test chatbot section images */
    .max-w-\[420px\], .max-w-\[320px\] {
        max-width: 100% !important;
        padding: 0 !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    .text-xl {
        font-size: 1.1rem !important;
    }

    .text-lg {
        font-size: 1rem !important;
    }

    /* Extra small mobile fixes */
    .max-w-screen-xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .group.p-8 {
        padding: 1rem !important;
    }
}