:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --bg-color: #e8ecf5;
    --surface-color: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --shadow-dark: #d1d9e6;
    --shadow-light: #ffffff;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-full: 50%;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #e8ecf5;
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.logo-splash {
    width: 150px;
    margin-bottom: var(--spacing-lg);
}

.loading-text {
    color: white;
    font-size: 16px;
    animation: pulse 1.5s infinite;
}

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

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 480px;
    width: 100%;
    background: var(--bg-color);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
}

.app-container.hidden {
    display: none;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.header-left {
    width: 44px;
}

.header-title {
    flex: 1;
    text-align: center;
}

.header-title h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

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

.header-right {
    width: 44px;
}

.neumorphic-button {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.neumorphic-button:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.chat-main {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    background: var(--bg-color);
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.logo-main {
    width: 240px;
    margin-bottom: var(--spacing-lg);
}

.welcome-title {
    font-size: 28px;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.messages-container.hidden {
    display: none;
}

.message {
    display: flex;
    animation: slideIn 0.3s ease;
}

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

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

.message.alba {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    line-height: 1.5;
}

.message.user .message-bubble {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 6px 6px 12px rgba(102, 126, 234, 0.3);
    border-bottom-right-radius: 6px;
}

.message.alba .message-bubble {
    background: var(--surface-color);
    color: var(--text-primary);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    border-bottom-left-radius: 6px;
}

.voice-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.voice-animation.hidden {
    display: none;
}

.sphere-animation {
    width: 200px;
    height: 200px;
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-full);
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
}

.voice-status {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.chat-footer {
    background: var(--bg-color);
    padding: var(--spacing-md);
}

.voice-button-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-color);
    border-radius: var(--radius-md);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1), inset -2px -2px 5px rgba(255, 255, 255, 0.7);
}

.neumorphic-button-small {
    width: 60px;
    height: 60px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.neumorphic-button-small:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.neumorphic-button-small:disabled {
    opacity: 1;
    cursor: pointer;
}

.neumorphic-button-small:disabled svg path {
    stroke: #cccccc;
}

.neumorphic-button-small.active {
    background: var(--bg-color);
    color: var(--primary-color);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
}

.neumorphic-button-small.active svg path {
    stroke: var(--primary-color);
}

.neumorphic-button-primary {
    width: 100px;
    height: 100px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-full);
    box-shadow: 8px 8px 16px rgba(102, 126, 234, 0.4), -8px -8px 16px rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.neumorphic-button-primary:active {
    transform: scale(0.95);
}

.voice-button.state-idle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.voice-button.state-listening {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse-listening 1.5s ease-in-out infinite;
}

@keyframes pulse-listening {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(240, 147, 251, 0.7), 8px 8px 16px rgba(240, 147, 251, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(240, 147, 251, 0), 8px 8px 20px rgba(240, 147, 251, 0.6);
    }
}

.voice-button.state-processing {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.voice-button.state-processing svg {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.voice-button.state-speaking {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    animation: pulse-speaking 0.8s ease-in-out infinite;
}

@keyframes pulse-speaking {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.menu-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.menu-content {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: var(--bg-color);
    overflow-y: auto;
    animation: slideInLeft 0.3s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.menu-header .header-title h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.menu-header .header-title p {
    font-size: 12px;
    color: var(--text-secondary);
}

.close-menu-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.menu-sections {
    padding: var(--spacing-md);
    padding-bottom: 80px;
}

.menu-section {
    margin-bottom: var(--spacing-lg);
}

.menu-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.menu-item {
    width: 100%;
    padding: var(--spacing-md);
    margin-bottom: 8px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    text-align: left;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-item:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.menu-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-color);
    padding: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}

.menu-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.menu-footer .copyright {
    margin-top: 8px;
    font-size: 10px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: var(--bg-color);
    overflow-y: auto;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-header .header-title h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-header .header-title p {
    font-size: 12px;
    color: var(--text-secondary);
}

.close-modal-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.modal-body {
    padding: var(--spacing-md);
    padding-bottom: 80px;
}

.profile-info {
    margin-bottom: var(--spacing-lg);
}

.profile-info p {
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--text-primary);
}

.profile-info p strong {
    color: var(--primary-color);
}

.profile-menu-item {
    width: 100%;
    padding: var(--spacing-md);
    margin-bottom: 8px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    text-align: left;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-menu-item:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.profile-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-color);
    padding: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}

.profile-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.profile-footer .copyright {
    margin-top: 8px;
    font-size: 10px;
}

.hidden {
    display: none !important;
}
