/* Phind AI - Ultimate Design with Pure Background Gradient */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

.phind-ai-container {
    --primary-1: #c084fc;
    --primary-2: #a855f7;
    --primary-3: #9333ea;
    --bg-deep: #000000;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --blur-xl: blur(20px);
    --blur-lg: blur(12px);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    
    font-family: 'Inter', sans-serif;
    position: relative;
    width: 100%;
    height: 100%;
}

/* GRADIENT ONLY ON BACKGROUND - No Blur */
.phind-chat-wrapper {
    position: relative;
    z-index: 10;
    height: 100%;
    min-height: 750px;
    
    /* PURE GRADIENT BACKGROUND - No Blur, No Box Shadow */
    background: radial-gradient(at 30% 30%, rgba(157, 0, 255, 0.35) 0px, transparent 60%),
                radial-gradient(at 80% 70%, rgba(27, 0, 255, 0.3) 0px, transparent 55%),
                radial-gradient(at 20% 80%, rgba(0, 247, 255, 0.15) 0px, transparent 50%),
                #000000;
    
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gradientShift 12s ease infinite;
}

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

/* Header - Solid Dark */
.phind-header {
    padding: 24px 30px;
    background: rgba(0, 0, 0, 0.7);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 20;
}

.phind-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.phind-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-1), var(--primary-3));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.phind-logo-icon svg {
    width: 26px;
    height: 26px;
}

.phind-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

/* Header Actions - Contains Info Icon and Fullscreen Button */
.phind-header-actions {
    display: flex;
    align-items: center;
    gap: 20px; /* Spacing between icons */
}

/* ===== INFO ICON - MINIMAL GLASSY DESIGN ===== */
.phind-info-icon {
    position: relative;
    cursor: pointer;
    z-index: 100;
}

.phind-info-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    font-size: 18px;
    font-style: italic;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    
    /* Subtle animation - only once */
    animation: subtleGlow 2s ease-in-out 1;
}

@keyframes subtleGlow {
    0% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        background: rgba(255, 255, 255, 0.03);
    }
    30% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
        background: rgba(255, 255, 255, 0.08);
    }
    70% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        background: rgba(255, 255, 255, 0.03);
    }
    100% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        background: rgba(255, 255, 255, 0.03);
    }
}

.phind-info-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    animation: none;
}

/* ===== TOOLTIP - GLASSY DESIGN WITH 4s TIMER ===== */
.phind-info-tooltip {
    position: absolute;
    top: 45px;
    right: -10px;
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 101;
    pointer-events: none;
    transform: translateY(-10px);
}

/* Invisible bridge to keep tooltip open */
.phind-info-icon::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

/* Show tooltip on hover with 4s duration */
.phind-info-icon:hover .phind-info-tooltip {
    animation: showTooltip 4s ease forwards;
    pointer-events: auto;
}

@keyframes showTooltip {
    0% {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
    }
    5% {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    95% {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
    }
}

.phind-tooltip-content {
    background: rgba(20, 20, 30, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    text-align: center;
    letter-spacing: 0.2px;
}

/* Link styling - ONLY Contact Page text is clickable */
.phind-tooltip-link {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px dotted rgba(167, 139, 250, 0.5);
}

.phind-tooltip-link:hover {
    color: white;
    border-bottom-color: white;
}

/* Fullscreen Button - OLD STYLE (RESTORED) */
.phind-fullscreen-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.phind-fullscreen-btn:hover {
    background: rgba(157, 0, 255, 0.15);
    border-color: rgba(157, 0, 255, 0.3);
    transform: scale(1.1);
}

.phind-fullscreen-btn svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.phind-fullscreen-btn:hover svg {
    transform: rotate(90deg);
}

/* Messages Area - Solid Dark with Slight Transparency */
.phind-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
    background: rgb(0 0 0 / 51%);
    z-index: 15;
    position: relative;
}

/* Custom Scrollbar */
.phind-messages::-webkit-scrollbar {
    width: 4px;
}

.phind-messages::-webkit-scrollbar-track {
    background: transparent;
}

.phind-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-1), var(--primary-3));
    border-radius: 4px;
}

/* Message - Solid Dark */
.phind-message {
    display: flex;
    gap: 16px;
    animation: messageSlide 0.4s ease;
}

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

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

.phind-message-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.phind-message.bot .phind-message-avatar {
    background: linear-gradient(135deg, rgba(157, 0, 255, 0.3), rgba(27, 0, 255, 0.3));
    border: 1px solid rgba(157, 0, 255, 0.3);
    color: white;
}

.phind-message-avatar svg {
    width: 24px;
    height: 24px;
}

.phind-message-content {
    max-width: 80%;
}

/* UPDATED: Bot message background */
.phind-message.bot .phind-message-text {
    padding: 16px 22px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    border: 1px solid rgba(157, 0, 255, 0.15);
    border-top-left-radius: 6px;
    background: rgb(0 0 0 / 51%);
}

.phind-message.user .phind-message-text {
    padding: 16px 22px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    border-top-right-radius: 6px;
    background: rgba(157, 0, 255, 0.2);
    border: 1px solid rgba(157, 0, 255, 0.3);
}

.phind-message-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: right;
}

/* UPDATED: Code blocks background */
.phind-message-text pre {
    background: rgb(53 51 51 / 13%) !important;
    border: 1px solid rgba(157, 0, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.phind-message-text code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(157, 0, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    color: #c084fc;
    font-size: 13px;
}

.phind-message-text pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
}

/* Thinking Animation */
.phind-message.thinking .phind-message-avatar svg {
    animation: thinkPulse 1.2s infinite;
}

@keyframes thinkPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.phind-message.thinking .phind-message-text {
    background: rgb(0 0 0 / 29%) !important;
    border: 1px solid rgba(157, 0, 255, 0.15);
}

.phind-thinking {
    display: flex;
    align-items: center;
    gap: 12px;
}

.phind-thinking span {
    color: #c084fc;
    font-weight: 500;
}

.phind-thinking-dots {
    display: flex;
    gap: 4px;
}

.phind-thinking-dots span {
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #c084fc, #9d00ff);
    border-radius: 50%;
    animation: thinkBounce 1.2s infinite;
}

.phind-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.phind-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Suggestions - SCROLLABLE ON MOBILE */
.phind-suggestions {
    padding: 22px 30px;
    background: rgba(0, 0, 0, 0.6);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    z-index: 20;
}

.phind-suggestions-header {
    margin-bottom: 16px;
}

.phind-suggestions-header span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 14px;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
}

/* Suggestions Grid - EXACTLY 7 ITEMS PER ROW ON DESKTOP */
.phind-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

/* Ensure all items stay in 7 columns */
.phind-suggestion-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    animation: suggestionPop 0.3s ease forwards;
    opacity: 0;
    transform: scale(0.95);
    width: 100%;
    min-width: 0;
}

@keyframes suggestionPop {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.phind-suggestion-btn:hover {
    background: rgba(157, 0, 255, 0.2);
    border-color: rgba(157, 0, 255, 0.3);
    transform: translateY(-2px);
}

.phind-suggestion-count {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 40px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.phind-suggestion-btn:hover .phind-suggestion-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* MOBILE VIEW - HORIZONTAL SCROLL */
@media (max-width: 1024px) {
    .phind-suggestions-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .phind-suggestions-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .phind-chat-wrapper {
        min-height: 600px;
    }
    
    .phind-header {
        padding: 18px 22px;
    }
    
    .phind-logo-icon {
        width: 42px;
        height: 42px;
    }
    
    .phind-logo-text {
        font-size: 20px;
    }
    
    .phind-header-actions {
        gap: 15px;
    }
    
    .phind-info-trigger {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .phind-fullscreen-btn {
        width: 48px;
        height: 48px;
    }
    
    .phind-fullscreen-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .phind-messages {
        padding: 22px;
    }
    
    .phind-suggestions {
        padding: 18px 22px;
    }
    
    .phind-input-area {
        padding: 18px 22px;
    }
    
    /* Mobile - Horizontal Scroll */
    .phind-suggestions-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
        scrollbar-width: thin !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        width: 100% !important;
    }
    
    .phind-suggestions-grid::-webkit-scrollbar {
        height: 3px !important;
        display: block !important;
    }
    
    .phind-suggestions-grid::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 10px !important;
    }
    
    .phind-suggestions-grid::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, var(--primary-1), var(--primary-3)) !important;
        border-radius: 10px !important;
    }
    
    .phind-suggestion-btn {
        flex: 0 0 auto !important;
        min-width: 140px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
    }
    
    /* Mobile tooltip adjustment */
    .phind-info-tooltip {
        min-width: 260px;
        right: -5px;
    }
    
    .phind-tooltip-content {
        padding: 14px 16px;
        font-size: 13px;
    }
}

/* Input Area */
.phind-input-area {
    padding: 22px 30px;
    background: rgba(0, 0, 0, 0.6);
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
    z-index: 20;
}

.phind-input-wrapper {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 60px;
    padding: 4px 4px 4px 24px;
    transition: all 0.2s ease;
}

.phind-input-wrapper:focus-within {
    border-color: rgba(157, 0, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(157, 0, 255, 0.1);
}

.phind-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 16px 0;
    resize: none;
    outline: none;
    max-height: 120px;
    font-family: inherit;
}

.phind-input::placeholder {
    color: var(--text-secondary);
}

.phind-send-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(157, 0, 255, 0.8), rgba(27, 0, 255, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.phind-send-btn:hover:not(:disabled) {
    transform: scale(1.1) rotate(10deg);
    background: linear-gradient(135deg, rgba(157, 0, 255, 0.9), rgba(27, 0, 255, 0.9));
}

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

.phind-send-btn svg {
    width: 24px;
    height: 24px;
}

/* Fullscreen Mode */
.phind-chat-wrapper:fullscreen {
    border-radius: 0;
    min-height: 100vh;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .phind-suggestions-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}