/* AIDESING AI Web App Styles */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0d1b2a;
    --accent: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --bg-dark: #0a0e1a;
    --bg-card: #111827;
    --bg-input: #1a202c;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --border: #2d3748;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.menu-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.menu-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
}

/* Avatar Section */
.avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.avatar-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
}

.avatar-glow {
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

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

.avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--primary-light), var(--primary));
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 40px var(--accent-glow),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.avatar-face {
    position: absolute;
    inset: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15%;
}

.avatar-eyes {
    display: flex;
    gap: 20%;
    width: 100%;
    justify-content: center;
}

.eye {
    width: 22%;
    height: 28%;
    background: var(--accent);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 15px var(--accent);
    animation: blink 4s ease-in-out infinite;
}

@keyframes blink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

.pupil {
    position: absolute;
    width: 40%;
    height: 40%;
    background: var(--bg-dark);
    border-radius: 50%;
    top: 30%;
    left: 30%;
}

.avatar-mouth {
    width: 35%;
    height: 12%;
    background: var(--accent);
    border-radius: 0 0 50% 50%;
    position: relative;
    overflow: hidden;
    animation: smile 3s ease-in-out infinite;
}

@keyframes smile {
    0%, 100% { border-radius: 0 0 40% 40%; width: 30%; }
    50% { border-radius: 0 0 60% 60%; width: 40%; }
}

.mouth-inner {
    position: absolute;
    width: 60%;
    height: 40%;
    background: var(--bg-dark);
    border-radius: 50%;
    bottom: -20%;
    left: 20%;
}

.avatar-circuit {
    position: absolute;
    inset: 0;
    opacity: 0.3;
}

.circuit-line {
    position: absolute;
    background: var(--accent);
    border-radius: 2px;
}

.line-1 {
    width: 2px;
    height: 30%;
    top: 10%;
    left: 20%;
    animation: circuit 2s ease-in-out infinite;
}

.line-2 {
    width: 2px;
    height: 25%;
    top: 60%;
    right: 25%;
    animation: circuit 2s ease-in-out infinite 0.5s;
}

.line-3 {
    width: 20%;
    height: 2px;
    bottom: 30%;
    left: 30%;
    animation: circuit 2s ease-in-out infinite 1s;
}

@keyframes circuit {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.avatar-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(72, 187, 120, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

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

.status-text {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

.welcome-text {
    text-align: center;
}

.welcome-text h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Quick Actions */
.quick-actions h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-card:hover {
    background: var(--bg-input);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.action-card i {
    font-size: 1.5rem;
    color: var(--accent);
}

.action-card span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Chat Section */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.chat-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
}

.bot-message {
    align-self: flex-start;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--accent);
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--accent);
    color: var(--primary-dark);
}

.message-content {
    background: var(--bg-input);
    padding: 0.875rem 1rem;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.user-message .message-content {
    background: var(--primary-light);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 4px;
}

.message-content p {
    margin-bottom: 0.5rem;
}

.message-content ul {
    margin: 0;
    padding-left: 1.25rem;
}

.message-content li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 1rem;
    align-self: flex-start;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out 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); }
}

/* Input Area */
.input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
}

.attach-btn, .voice-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-btn:hover, .voice-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 20px;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
}

.input-wrapper:focus-within {
    border-color: var(--primary-light);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.send-btn:active {
    transform: scale(0.95);
}

/* Skills Panel */
.skills-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 200;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.skills-panel.active {
    right: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.close-panel {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.close-panel:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.skills-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.skill-item:hover {
    background: var(--bg-input);
}

.skill-item i {
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent);
}

.skill-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.skill-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.skill-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 480px) {
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .avatar-wrapper {
        width: 120px;
        height: 120px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message {
    animation: fadeIn 0.3s ease;
}
