/* Enhanced AI Career Agent UI/UX */

/* Modern Color Palette */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    height: 100vh;
    overflow: hidden;
}

.gemini-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-main);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Header */
.gemini-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px 30px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.gemini-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    cursor: pointer;
    color: white;
    transition: all 0.3s;
}

.action-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.mode-btn {
    flex: 1;
    padding: 14px 24px;
    border: 2px solid var(--border);
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.mode-btn:hover::before {
    left: 100%;
}

.mode-btn:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.mode-btn i {
    font-size: 16px;
}

/* Resume Upload */
.resume-upload-section {
    padding: 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.chat-history-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
}

.history-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-history-list {
    list-style: none;
}

.chat-history-list li {
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-main);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.chat-history-list li:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}

.chat-history-list li.active {
    background: var(--primary);
    color: white;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-card);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Messages */
.message {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.bot-message .message-avatar,
.system-message .message-avatar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
    color: white;
}

.error-message .message-avatar {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.message-content {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bot-message .message-content,
.system-message .message-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.error-message .message-content {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.system-message .message-content {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.message-content strong {
    color: var(--primary-light);
    font-weight: 600;
}

.user-message .message-content strong {
    color: white;
}

.message-content code {
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
}

/* Input Container */
.input-container {
    padding: 20px 30px 30px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.input-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.input-field {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 6px;
    transition: all 0.3s;
}

.input-field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 18px;
    font-size: 15px;
    outline: none;
    color: var(--text-primary);
}

#chat-input::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.input-footer {
    text-align: center;
    margin-top: 12px;
}

.disclaimer {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Typing Indicator */
.typing-indicator {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 12px 24px;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
}

.typing-animation {
    display: flex;
    gap: 6px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Agent Status */
.agent-status {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    z-index: 1000;
}

.agent-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-history-sidebar {
        display: none;
    }
    
    .mode-switcher {
        flex-direction: column;
        gap: 8px;
    }
    
    .mode-btn {
        min-width: auto;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .gemini-header h1 {
        font-size: 18px;
    }
}
