:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #f1f5f9;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --highlight-color: #3b82f6;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.app-wrapper {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    max-height: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-radius: 24px 24px 24px 24px;
    overflow: hidden;
}

/* German License Plate Sidebar */
.sidebar {
    width: 320px;
    background: #2563eb;
    position: relative;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.plate-eu-section {
    display: none;
}

.eu-flag {
    display: none;
}

.eu-stars-circle {
    display: none;
}

.country-code-big {
    display: none;
}

.sidebar-logo {
    padding: 32px 20px 24px 20px;
    text-align: center;
}

.sidebar-logo-img {
    width: 85%;
    height: auto;
    max-height: 70px;
    filter: brightness(0) invert(1);
}

.sidebar-progress-percent {
    padding: 0 20px 20px 20px;
    margin-bottom: 10px;
}

.sidebar-progress-percent span {
    display: inline-block;
    background: white;
    color: #2563eb;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.categories-section {
    flex: 1;
    overflow-y: auto;
}

.category-section {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    user-select: none;
}

.section-toggle {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.category-section.collapsed .section-toggle {
    transform: rotate(180deg);
}

.category-section.collapsed .category-items {
    display: none;
}

.category-items {
    padding: 0;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px 14px 40px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.category-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.category-item.completed {
    opacity: 0.5;
}

.step-indicator {
    font-size: 10px;
    min-width: 12px;
}

.category-item.active .step-indicator {
    color: #2563eb;
}

.step-text {
    flex: 1;
}

/* Hide sidebar on mobile */
@media (max-width: 968px) {
    .sidebar {
        display: none;
    }

    .app-wrapper {
        max-width: 800px;
    }
}

.container {
    flex: 1;
    width: 100%;
    background: white;
    border-radius: 0 24px 24px 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    position: relative;
    background: #f3f4f6;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: none;
}

.logo-image {
    display: none;
}

.progress-bar {
    display: none;
}

.progress-fill {
    display: none;
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 24px;
    right: 32px;
}

.language-dropdown {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #eff6ff;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.language-dropdown:hover {
    border-color: var(--primary-color);
}

.language-dropdown:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: #f8fafc;
}

.welcome-message {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease;
}

.bot-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: var(--bg-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.avatar-icon {
    width: 48px;
    height: 48px;
}

.bot-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

/* Message Styles */
.message {
    display: flex;
    margin-bottom: 24px;
    animation: fadeInUp 0.4s ease;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: var(--bg-gradient);
    color: white;
    margin-right: 12px;
}

.message.user .message-avatar {
    background: var(--primary-color);
    color: white;
    margin-left: 12px;
    order: 2;
}

.message-avatar svg {
    width: 24px;
    height: 24px;
}

.message-content {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 16px;
    line-height: 1.5;
}

.message.bot .message-content {
    background: #eff6ff;
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

/* Document Container with Highlights */
.document-container {
    margin: 20px 0;
    animation: fadeInUp 0.4s ease;
}

.document-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 500px;
}

.document-image-wrapper img {
    width: 100%;
    display: block;
}

.document-highlight {
    position: absolute;
    background: rgba(59, 130, 246, 0.3);
    border: 3px solid var(--highlight-color);
    border-radius: 6px;
    animation: pulse 2s infinite;
    cursor: pointer;
    transition: all 0.3s ease;
}

.document-highlight:hover {
    background: rgba(59, 130, 246, 0.4);
}

.highlight-label {
    position: absolute;
    top: -32px;
    left: 0;
    background: var(--highlight-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Input Area */
.input-area {
    padding: 24px 32px;
    background: #eff6ff;
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

#userInput {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: #eff6ff;
}

#userInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: #dbeafe;
}

/* Number Input (Separated Digits) */
.number-input-container {
    display: flex;
    gap: 12px;
    flex: 1;
}

.number-digit-input {
    width: 60px;
    height: 60px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: #eff6ff;
    text-transform: uppercase;
}

.number-digit-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: scale(1.05);
}

/* Date Input */
.date-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.date-group {
    flex: 1;
}

.date-digit-input {
    width: 100%;
    height: 60px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: #eff6ff;
}

.date-digit-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.date-separator {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
}

/* Name Input */
.name-input-container {
    display: flex;
    gap: 12px;
    flex: 1;
}

.name-group {
    flex: 1;
}

.name-field-input {
    width: 100%;
    height: 60px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: #eff6ff;
}

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

/* License Plate Input */
.plate-input-container {
    flex: 1;
}

.plate-preview-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #eff6ff;
    border: 3px solid #000;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.plate-flag {
    background: #003399;
    color: white;
    padding: 8px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.plate-region {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    padding: 0 8px;
}

.plate-letters,
.plate-numbers {
    font-size: 22px;
    font-weight: bold;
    border: none;
    outline: none;
    text-transform: uppercase;
    padding: 8px;
    background: transparent;
    text-align: center;
}

.plate-letters {
    width: 70px;
}

.plate-numbers {
    width: 100px;
}

/* License Plate Display */
.license-plate-display {
    margin: 24px 0;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.plate-visual {
    display: inline-flex;
    align-items: center;
    background: #eff6ff;
    border: 3px solid #000;
    border-radius: 8px;
    padding: 12px 16px;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.plate-flag {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #003399;
    padding: 8px 6px;
    border-radius: 4px;
}

.eu-stars {
    color: #FFDD00;
    font-size: 12px;
    margin-bottom: 4px;
}

.country-code {
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.plate-content {
    font-size: 32px;
    color: #000;
    letter-spacing: 2px;
}

.plate-region-display {
    margin-right: 8px;
}

.plate-letters-display {
    margin-right: 4px;
}

.plate-info {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* Region Selector */
.region-button {
    padding: 12px;
    border: 2px solid var(--border-color);
    background: #eff6ff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.region-button:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.region-logo-wrapper {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background: white;
    padding: 4px;
}

.region-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.region-info {
    text-align: center;
    width: 100%;
}

.region-name {
    font-size: 12px;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.2;
}

.region-city {
    font-size: 10px;
    color: var(--text-light);
    font-weight: 400;
}

.send-button {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-button:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.send-button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: scale(1);
}

/* Options Container */
.options-container {
    display: none;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.option-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border: 2px solid var(--primary-color);
    background: #eff6ff;
    color: var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.option-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.option-button svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Primary Action Button */
.primary-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.primary-action-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* Summary Container */
.summary-container {
    background: #eff6ff;
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.5s ease;
}

.summary-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.summary-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-section h4 {
    color: var(--primary-color);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-weight: 700;
}

.summary-section p {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.6;
    margin: 4px 0;
}

/* Completion Container */
.completion-container {
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.6s ease;
}

.completion-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: scaleIn 0.5s ease;
}

.completion-container h2 {
    color: var(--success-color);
    font-size: 28px;
    margin-bottom: 24px;
}

.completion-plate {
    margin: 32px 0;
}

.completion-container p {
    color: var(--text-light);
    font-size: 16px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: #eff6ff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
}

.close-button {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: var(--secondary-color);
    color: var(--text-color);
}

.modal-body {
    padding: 32px 24px;
}

.verification-loader {
    text-align: center;
}

.spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    border: 4px solid var(--secondary-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.verification-result {
    text-align: center;
}

.success-icon {
    margin-bottom: 24px;
}

.verification-result h4 {
    color: var(--success-color);
    font-size: 24px;
    margin-bottom: 12px;
}

.verification-result p {
    color: var(--text-light);
    font-size: 16px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 16px;
}

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

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

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

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

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

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .header {
        padding: 16px 20px;
    }

    .logo-image {
        height: 36px;
    }

    .chat-container {
        padding: 20px;
    }

    .message-content {
        max-width: 85%;
    }

    .input-area {
        padding: 16px 20px;
    }

    .number-digit-input {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .date-digit-input {
        height: 48px;
        font-size: 18px;
    }

    .send-button {
        width: 48px;
        height: 48px;
    }

    .plate-visual {
        font-size: 24px;
    }
}

/* Custom Scrollbar */
.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

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

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
