/**
 * PC Builder - AI Chat Interface
 * Dark Gaming Theme with Neon Accents
 * Version: 2.0 - December 2025
 */

/* ============================================
   DARK GAMING THEME - GLOBAL STYLES
   ============================================ */
:root {
    --dark-bg-primary: #0a0e27;
    --dark-bg-secondary: #141832;
    --dark-bg-tertiary: #1a1f3a;
    --dark-surface: rgba(255, 255, 255, 0.05);
    --dark-border: rgba(255, 255, 255, 0.1);
    
    --neon-cyan: #00d9ff;
    --neon-purple: #a855f7;
    --neon-pink: #ec4899;
    --neon-blue: #3b82f6;
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    --glow-cyan: 0 0 20px rgba(0, 217, 255, 0.5);
    --glow-purple: 0 0 20px rgba(168, 85, 247, 0.5);
}

/* Hero Section - Gaming Style */
.pc-builder-hero {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0a0e27 100%);
    position: relative;
    padding: 5rem 0;
    text-align: center;
    overflow: hidden;
}

.pc-builder-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 217, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.pc-builder-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: var(--glow-cyan);
    position: relative;
    z-index: 1;
}

.pc-builder-hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

/* Chat Container - Glassmorphism Dark */
.ai-chat-container {
    max-width: 900px;
    margin: 3rem auto;
    background: rgba(20, 24, 50, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--dark-border);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Chat Header - Neon Accent */
.chat-header {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(168, 85, 247, 0.1));
    padding: 1.5rem;
    border-bottom: 1px solid var(--dark-border);
    position: relative;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    opacity: 0.5;
}

.chat-header h3 {
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.ai-badge {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    color: white;
    font-size: 0.7rem;
    padding: 0.35rem 0.85rem;
    border-radius: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--glow-purple);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(168, 85, 247, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 217, 255, 0.8); }
}

/* Messages Container - Dark */
.chat-messages {
    height: 450px;
    overflow-y: auto;
    padding: 2rem;
    background: var(--dark-bg-primary);
}

/* Custom Scrollbar - Gaming Style */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-purple), var(--neon-pink));
}

/* Message Bubbles */
.message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

/* Avatar - Neon Circles */
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
    border: 2px solid rgba(0, 217, 255, 0.3);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    border: 2px solid rgba(168, 85, 247, 0.3);
}

/* Message Content - Dark Cards */
.message-content {
    max-width: 75%;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    line-height: 1.6;
    position: relative;
    font-size: 0.95rem;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
}

.message.assistant .message-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--dark-border);
    border-bottom-left-radius: 6px;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

/* Typing Indicator - Neon Animation */
.message.typing .message-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.typing-dots {
    display: flex;
    gap: 6px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-cyan);
    animation: typing 1.4s infinite ease-in-out;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.typing-dots span:nth-child(2) { 
    animation-delay: 0.2s; 
}

.typing-dots span:nth-child(3) { 
    animation-delay: 0.4s; 
}

@keyframes typing {
    0%, 80%, 100% { 
        opacity: 0.3; 
        transform: scale(0.8); 
    }
    40% { 
        opacity: 1; 
        transform: scale(1.2);
        box-shadow: 0 0 15px var(--neon-cyan); 
    }
}

/* Chat Input - Gaming Style */
.chat-input {
    padding: 1.5rem;
    border-top: 1px solid var(--dark-border);
    background: rgba(20, 24, 50, 0.6);
    backdrop-filter: blur(10px);
}

.input-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    min-height: 48px;
}

.chat-textarea::placeholder {
    color: var(--text-muted);
}

.chat-textarea:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.2), inset 0 0 20px rgba(0, 217, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

/* Send Button - Neon Glow */
.send-btn {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    color: white;
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.6);
}

.send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    transition: transform 0.3s ease;
}

.send-btn:hover:not(:disabled) svg {
    transform: translateX(2px);
}

/* Quick Prompts - Gaming Cards */
.quick-prompts {
    max-width: 900px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
}

.quick-prompts h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

.prompt-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.prompt-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.prompt-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.1), transparent);
    transition: left 0.5s;
}

.prompt-btn:hover::before {
    left: 100%;
}

.prompt-btn:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 217, 255, 0.3);
}

.prompt-btn:active {
    transform: translateY(0);
}

/* Fallback Notice - Dark */
.fallback-notice {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: 16px;
    color: var(--text-primary);
    text-align: center;
    backdrop-filter: blur(10px);
}

.fallback-notice strong {
    color: var(--neon-pink);
}

/* Responsive Design */
@media (max-width: 768px) {
    .pc-builder-hero h1 {
        font-size: 2rem;
    }
    
    .pc-builder-hero p {
        font-size: 1rem;
    }
    
    .ai-chat-container {
        margin: 1.5rem 1rem;
        border-radius: 16px;
    }
    
    .chat-messages {
        height: 350px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .prompt-buttons {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(0, 217, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
}
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: #0056b3;
}

.send-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.quick-prompts {
    margin-top: 2rem;
    text-align: center;
}

.quick-prompts h4 {
    margin-bottom: 1rem;
    color: #495057;
}

.prompt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.prompt-btn {
    background: white;
    border: 2px solid #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-btn:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.component-preview {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.component-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.component-card h5 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #495057;
}

.component-card .price {
    font-weight: 600;
    color: #007bff;
}

.fallback-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pc-builder-hero h1 { 
        font-size: 2rem; 
    }
    
    .ai-chat-container { 
        margin: 2rem 1rem; 
    }
    
    .chat-messages { 
        height: 300px; 
    }
    
    .message-content { 
        max-width: 85%; 
    }
    
    .prompt-buttons { 
        justify-content: stretch; 
    }
    
    .prompt-btn { 
        flex: 1; 
        text-align: center; 
    }
}