/* Google-inspired Design System */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --danger: #ea4335;
    --success: #34a853;
    --warning: #fbbc04;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    --border: #dadce0;
    --background: #f8f9fa;
    --surface: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-md: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --shadow-lg: 0 1px 3px 0 rgba(60,64,67,0.3), 0 8px 16px 4px rgba(60,64,67,0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

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

[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 8px 12px;
}

.btn-text:hover {
    background: var(--primary-light);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #d33828;
}

.btn-icon {
    padding: 8px;
    border-radius: 50%;
}

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

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 48px 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.2s;
    background: var(--surface);
    padding: 0 4px;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 12px;
    color: var(--primary);
}

.error-message {
    padding: 12px 16px;
    background: #fce8e6;
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.login-form .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 12px;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

.logo-small svg {
    display: block;
}

/* Main Content */
.main {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 65px);
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-message {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.welcome-message h2 {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.welcome-message p {
    margin-bottom: 8px;
}

.welcome-message .hint {
    font-size: 12px;
    color: var(--text-muted);
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    animation: fadeIn 0.3s ease;
}

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

.message-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.message-assistant {
    align-self: flex-start;
    background: var(--background);
    color: var(--text-primary);
    border-bottom-left-radius: var(--radius-sm);
}

.message-error {
    align-self: center;
    background: #fce8e6;
    color: var(--danger);
    max-width: 90%;
}

.message-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    gap: 16px;
}

.message-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Status Bar */
.status-bar {
    padding: 16px 24px;
    background: var(--primary-light);
    border-top: 1px solid var(--border);
}

.status-steps {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.status-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.status-step .step-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    position: relative;
}

.status-step.active {
    color: var(--primary);
}

.status-step.active .step-icon {
    border-color: var(--primary);
    background: var(--primary-light);
}

.status-step.active .step-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Weniger aggressive Animation für Status-Schritte */
@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.status-step.done {
    color: var(--success);
}

.status-step.done .step-icon {
    border-color: var(--success);
    background: var(--success);
}

.status-step.done .step-icon::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: none;
}

/* Input Area */
.input-container {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px 8px 8px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: 150px;
    font-family: inherit;
}

.input-actions {
    display: flex;
    gap: 4px;
}

.input-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

#mic-btn {
    color: var(--text-secondary);
}

#mic-btn:hover {
    background: var(--background);
    color: var(--primary);
}

#mic-btn.recording {
    color: var(--danger);
    animation: pulse 1s infinite;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal[hidden] {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 48px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.recording-indicator {
    position: relative;
    margin-bottom: 24px;
}

.recording-indicator .pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(234, 67, 53, 0.2);
    border-radius: 50%;
    animation: pulseRing 1.5s infinite;
}

@keyframes pulseRing {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
    }

    .header-content {
        padding: 12px 16px;
    }

    .main {
        padding: 16px;
    }

    .chat-messages {
        padding: 16px;
    }

    .message {
        max-width: 90%;
    }

    .status-steps {
        gap: 16px;
    }

    .status-step span {
        display: none;
    }

    .input-container {
        padding: 12px 16px 16px;
    }

    .welcome-message {
        padding: 32px 16px;
    }

    .welcome-message h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 16px;
    }

    .input-wrapper textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

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

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

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

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