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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --background: #f5f6fa;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --header-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
header {
    background: var(--primary-color);
    color: white;
    padding: 0 1rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 1.2rem;
    flex: 1;
    text-align: center;
}

/* Menu Toggle Button */
.menu-toggle {
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

.menu-toggle span {
    display: block;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Admin Button */
.admin-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.side-menu.active {
    left: 0;
}

.menu-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.menu-header h2 {
    font-size: 1.2rem;
}

.close-menu {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    border-bottom: 1px solid var(--border-color);
}

.category-list a {
    display: block;
    padding: 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s;
}

.category-list a:active,
.category-list a:hover {
    background: var(--background);
}

.category-list a.active {
    background: var(--secondary-color);
    color: white;
}

/* Main Content */
main {
    margin-top: var(--header-height);
    padding: 1rem;
    min-height: calc(100vh - var(--header-height));
}

.welcome-message {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.welcome-message h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Tips Display */
.tips-container {
    max-width: 800px;
    margin: 0 auto;
}

.category-title {
    color: var(--primary-color);
    margin: 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.tip-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.tip-card:active {
    transform: scale(0.98);
}

.tip-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.tip-content {
    color: var(--text-color);
    line-height: 1.8;
    white-space: pre-wrap;
}

.tip-content strong {
    color: var(--primary-color);
    display: block;
    margin: 0.5rem 0;
}

/* Chat Dialog Styles */
.chat-dialog {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
    animation: fadeInUp 0.3s ease-out;
}

.chat-bubble.vorwurf {
    background: #e74c3c;
    color: white;
    align-self: flex-start;
    margin-left: 0.5rem;
    border-bottom-left-radius: 4px;
}

.chat-bubble.vorwurf::before {
    content: "🗣️";
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.chat-bubble.antwort {
    background: var(--secondary-color);
    color: white;
    align-self: flex-end;
    margin-right: 0.5rem;
    border-bottom-right-radius: 4px;
}

.chat-bubble.antwort::after {
    content: "💬";
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.chat-bubble-label {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-bubble-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-bubble.antwort ul,
.chat-bubble.antwort li {
    margin: 0.5rem 0;
    padding-left: 1rem;
    list-style: none;
}

.chat-bubble.antwort li::before {
    content: "→ ";
    margin-left: -1rem;
    font-weight: bold;
}

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

/* Responsive Chat */
@media (max-width: 480px) {
    .chat-bubble {
        max-width: 90%;
    }

    .chat-bubble.vorwurf::before,
    .chat-bubble.antwort::after {
        display: none;
    }
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
}

input, textarea, select {
    margin: 0.5rem 0;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

button[type="submit"], .btn {
    background: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background 0.2s;
}

button[type="submit"]:hover, .btn:hover {
    background: #2980b9;
}

/* Admin Panel */
.admin-panel {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    overflow-y: auto;
    z-index: 999;
    padding: 1rem;
}

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

.logout-btn {
    background: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    background: var(--background);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.tab-btn.active {
    background: var(--secondary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.add-btn {
    background: var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 1rem;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-item {
    background: var(--background);
    padding: 1rem;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-item-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn, .delete-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

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

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

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

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

/* PWA Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: none;
    animation: slideUp 0.3s;
}

.install-prompt.show {
    display: block;
}

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

.install-btn, .dismiss-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

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

.dismiss-btn {
    background: transparent;
    color: white;
    border: 1px solid white;
}

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

/* Responsive Design */
@media (min-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .tip-card {
        padding: 2rem;
    }

    .admin-panel {
        padding: 2rem;
    }
}