/* ========== IMPORTED FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap');

/* ========== GLOBAL STYLES ========== */
* {
    font-family: "Montserrat", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    padding-top: 80px;
    background: #191919;
    color: white;
    min-height: 100vh;
    overflow: hidden; /* Prevent body scroll - chat handles its own scrolling */
}

a {
    font-size: 16px;
    font-weight: 500;
    color: #edf0f1;
    text-decoration: none;
}

/* ========== NAVBAR STYLES ========== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #191919;
    z-index: 1000; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.lg {
    cursor: pointer;
    font-size: 24px;
    font-weight: 700;
}

.pop {
    color: #f9e368;
}

.together {
    color: #EF3E3A;
}

.nav_links {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav_links li {
    display: inline-block;
    padding: 0px 20px;
}

.nav_links li a {
    transition: all 0.3s ease 0s;
}

.nav_links li a.active {
  position: relative;
  color: #fff;
}

.nav_links li a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  background-color: #EF3E3A;
  border-radius: 2px;
}

.nav_links li a:hover {
    color: #EF3E3A;
    text-shadow: 0 6px 15px rgba(239, 62, 58, 0.6);
}

button {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    padding: 9px 25px;
    background: linear-gradient(90deg, #EF3E3A, #A65396);
    border-radius: 5px;
    border: none;
    transition: all 0.3s ease 0s;
    cursor: pointer;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(239, 62, 58, 0.6);
}

.cta {
    display: inline-block;
    text-decoration: none;
}

/* ========== DESKTOP AUTH AREA ========== */
.desktop-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

.desktop-user-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

#desktopUsername {
    font-size: 16px;
    font-weight: 600;
    color: #f9e368;
    padding: 8px 15px;
    background: rgba(249, 227, 104, 0.1);
    border-radius: 5px;
    white-space: nowrap;
}

/* ========== MOBILE MENU TOGGLE ========== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========== MOBILE AUTH SECTION ========== */
.mobile-auth-section {
    display: none !important;
}

.mobile-login-wrapper,
.mobile-user-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.mobile-login-btn {
    width: 80%;
    text-align: center;
}

.mobile-login-btn button {
    width: 100%;
    padding: 12px 25px;
}

.mobile-username {
    font-size: 18px;
    font-weight: 600;
    color: #f9e368;
    padding: 10px 20px;
    background: rgba(249, 227, 104, 0.1);
    border-radius: 5px;
    text-align: center;
}

.mobile-logout-btn {
    width: 80%;
    padding: 12px 25px;
}

/* ========== FULL-SCREEN AI CHAT LAYOUT ========== */
.ai-chat-fullscreen {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: #191919;
    overflow: hidden;
}

/* ========== CHAT HEADER (PopCorn AI Branding) ========== */
.chat-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    background: #191919;
    flex-shrink: 0;
}

.ai-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f9e368, #f9c74f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #191919;
    flex-shrink: 0;
}

.ai-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ai-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.ai-label {
    color: #EF3E3A;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #aaa;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========== CHAT MESSAGES ========== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(to bottom, #1a1a1a, #191919);
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========== MESSAGE STYLES ========== */
.message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
    max-width: 900px;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #f9e368, #f9c74f);
    color: #191919;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #EF3E3A, #A65396);
    color: white;
}

.message-content {
    flex: 1;
    max-width: 85%;
}

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

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

.message-bubble {
    padding: 15px 20px;
    border-radius: 15px;
    line-height: 1.6;
}

.ai-message .message-bubble {
    background: #2a2a2a;
    border: 1px solid #333;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #EF3E3A, #A65396);
}

.message-bubble p {
    margin: 0 0 10px 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-bubble ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message-bubble ul li,
.message-bubble ol li {
    margin: 5px 0;
}

.message-bubble .suggestion-list {
    list-style: none;
    padding-left: 0;
}

.message-bubble .suggestion-list li {
    padding: 8px 12px;
    background: rgba(249, 227, 104, 0.1);
    border-left: 3px solid #f9e368;
    margin: 8px 0;
    border-radius: 5px;
    font-size: 0.95rem;
}

.message-bubble strong {
    color: #f9e368;
}

/* ========== TYPING INDICATOR ========== */
.typing-indicator {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 30px 20px 30px;
    max-width: 900px;
}

.typing-dots {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
    background: #2a2a2a;
    border-radius: 15px;
    border: 1px solid #333;
}

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

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

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

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

/* ========== SUGGESTION CHIPS (Above Input) ========== */
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 30px;
    justify-content: center;
    background: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.suggestion-chips.hidden {
    display: none;
}

.chip {
    padding: 10px 18px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.chip:hover {
    background: linear-gradient(90deg, #EF3E3A, #A65396);
    border-color: #EF3E3A;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 62, 58, 0.4);
}

/* ========== CHAT INPUT AREA ========== */
.chat-input-area {
    padding: 20px 30px;
    background: #191919;
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    max-width: 900px;
    margin: 0 auto;
}

#userInput {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 12px 15px;
    color: white;
    font-size: 16px;
    font-family: "Montserrat", sans-serif;
    resize: none;
    max-height: 120px;
    transition: border-color 0.3s;
}

#userInput:focus {
    outline: none;
    border-color: #f9e368;
}

#userInput::placeholder {
    color: #666;
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-info {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    max-width: 900px;
    margin: 5px auto 0 auto;
}

/* ========== RESPONSIVE MEDIA QUERIES ========== */

/* Tablet and below (992px) */
@media screen and (max-width: 992px) {
    .nav_links li {
        padding: 0px 10px;
    }
    
    .nav_links li a {
        font-size: 14px;
    }

    .chat-header {
        padding: 15px 20px;
    }

    .ai-name {
        font-size: 1.3rem;
    }

    .chat-messages {
        padding: 20px;
    }

    .typing-indicator {
        padding: 0 20px 15px 20px;
    }

    .suggestion-chips {
        padding: 12px 20px;
    }

    .chat-input-area {
        padding: 15px 20px;
    }
}

/* ========== MOBILE (768px and below) ========== */
@media screen and (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    /* ========== NAVBAR MOBILE ========== */
    header {
        padding: 12px 3%;
    }
    
    .lg {
        font-size: 20px;
    }
    
    .desktop-auth {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: #191919;
        transition: left 0.3s ease;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        overflow-y: auto;
        z-index: 999;
    }
    
    nav.active {
        left: 0;
    }
    
    .nav_links {
        flex-direction: column;
        padding: 20px 0;
        width: 100%;
    }
    
    .nav_links li {
        display: block;
        padding: 15px 20px;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav_links li a {
        font-size: 18px;
        display: block;
        width: 100%;
    }
    
    .mobile-auth-section {
        display: block !important;
        padding: 20px 0 10px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 10px;
    }
    
    /* ========== AI CHAT MOBILE ========== */
    .ai-chat-fullscreen {
        top: 70px;
    }

    .chat-header {
        padding: 12px 15px;
    }

    .ai-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .ai-name {
        font-size: 1.1rem;
    }

    .ai-status {
        font-size: 0.8rem;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .message-content {
        max-width: 90%;
    }

    .typing-indicator {
        padding: 0 15px 12px 15px;
    }
    
    .suggestion-chips {
        padding: 10px 15px;
        gap: 8px;
    }
    
    .chip {
        font-size: 12px;
        padding: 8px 14px;
    }

    .chat-input-area {
        padding: 12px 15px;
    }

    .input-wrapper {
        gap: 8px;
    }

    #userInput {
        font-size: 14px;
        padding: 10px 12px;
    }

    .send-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* ========== SMALL MOBILE (480px and below) ========== */
@media screen and (max-width: 480px) {
    .lg {
        font-size: 18px;
    }
    
    button {
        font-size: 14px;
        padding: 8px 20px;
    }

    .chat-header {
        padding: 10px 12px;
        gap: 10px;
    }

    .ai-avatar {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .ai-name {
        font-size: 1rem;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .message-bubble {
        padding: 12px 15px;
        font-size: 14px;
    }

    .suggestion-chips {
        padding: 8px 12px;
    }

    .chip {
        font-size: 11px;
        padding: 6px 12px;
    }

    .chat-input-area {
        padding: 10px 12px;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}