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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #6a5acd 0%, #8b5a96 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 1.5rem;
}

.tab-buttons {
    display: flex;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.tab-button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    font-weight: 500;
    border-right: 1px solid #ddd;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background: #d6d8db;
    color: #495057;
}

.tab-button.active {
    background: #7b68ee;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #7b68ee;
}

button {
    width: 100%;
    padding: 0.75rem;
    background: #7b68ee;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
}

button:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.error {
    color: #e74c3c;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.success {
    color: #27ae60;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.hidden {
    display: none;
}

.dashboard {
    text-align: center;
}

.section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.section h3 {
    margin-bottom: 1rem;
    color: #333;
}

.user-info {
    background: #e8f4fd;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.pair-info {
    background: #e8f5e8;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.question-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 500;
}

.answer-section {
    margin: 1rem 0;
}

.answer-box {
    background: #f0f8ff;
    border: 1px solid #d0e7ff;
    border-radius: 5px;
    padding: 1rem;
    margin: 0.5rem 0;
}

.answer-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 0.5rem;
}

.answer-text {
    color: #333;
}

.pending-answer {
    color: #888;
    font-style: italic;
}

textarea {
    width: 100%;
    min-height: 250px;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #7b68ee;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-right: 0.5rem;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background: #dc3545;
    color: white;
    font-weight: 500;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.nav-tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.nav-tab {
    flex: 1;
    padding: 1rem 0.75rem;
    background: #e9ecef;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    font-weight: 500;
    border-right: 1px solid #ddd;
}

.nav-tab:last-child {
    border-right: none;
}

.nav-tab:hover {
    background: #d6d8db;
    color: #495057;
    transform: translateY(-2px);
}

.nav-tab.active {
    background: #7b68ee;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 -3px 10px rgba(102, 126, 234, 0.3);
}

.tab-content {
    display: none;
}

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

.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.preference-info {
    flex: 1;
}

.preference-title {
    font-weight: bold;
    color: #333;
}

.preference-description {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.preference-status {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.status-active {
    color: #28a745;
}

.status-inactive {
    color: #dc3545;
}

.status-waiting {
    color: #ffc107;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #7b68ee;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.logout-btn {
    background: #e74c3c;
    color: white;
    margin-top: 1rem;
    font-weight: 500;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.admin-btn {
    background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-btn:hover {
    background: linear-gradient(135deg, #c2185b 0%, #880e4f 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4);
}

.question-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.question-nav .btn {
    flex: 1;
    max-width: 200px;
}

.question-nav .btn.active {
    background: #7b68ee;
    color: white;
}

.history-item {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1.5rem;
}

.history-date {
    font-weight: bold;
    color: #7b68ee;
    margin-bottom: 0.5rem;
}

.history-question {
    font-style: italic;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #e9ecef;
    border-radius: 5px;
}

.history-answers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-block {
    padding: 1rem;
    border-radius: 5px;
    background: white;
    border: 1px solid #ddd;
}

.answer-author {
    font-weight: bold;
    color: #7b68ee;
    margin-bottom: 0.5rem;
}

.answer-text {
    line-height: 1.5;
    white-space: pre-line; /* Zeilenumbrüche (\n) als sichtbare Absätze rendern */
    word-break: break-word; /* Lange, untrennbare Wörter umbrechen */
}

/* Kommentarbereich */
.comment-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fefefe;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.comment-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #333;
}
.comment-entry {
    background: #f0f4ff;
    border: 1px solid #d0e3ff;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}
.comment-author {
    font-weight: 600;
    color: #4a5fd8;
    margin-bottom: 0.25rem;
}
.comment-text {
    white-space: pre-line;
    word-break: break-word;
    color: #222;
    font-size: 0.95rem;
}
.comment-meta {
    font-size: 0.7rem;
    color: #777;
    margin-top: 4px;
}
.comment-form textarea {
    min-height: 120px;
    border-color: #7b68ee;
}
.comment-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.edit-comment-btn {
    background: #6c757d;
}
.save-comment-btn {
    background: #28a745;
}
.cancel-comment-btn {
    background: #dc3545;
}

.no-history {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

.loading {
    text-align: center;
    color: #7b68ee;
    font-style: italic;
    padding: 2rem;
}

.history-navigation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.nav-button {
    background: #7b68ee;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    min-width: 40px;
    transition: all 0.3s ease;
}

.nav-button:hover:not(:disabled) {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
}

.current-date {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.history-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-mode-toggle {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.view-mode-toggle:hover {
    background: #5a6268;
}

.view-mode-toggle.active {
    background: #28a745;
}

@media (max-width: 768px) {
    .question-nav {
        flex-direction: column;
    }
    
    .question-nav .btn {
        max-width: none;
    }

    .date-selector, .history-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Confirm answer styles */
.confirm-section {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    text-align: center;
}

.answer-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.edit-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4142 100%);
    transform: translateY(-1px);
}

.confirm-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.confirm-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #17a2b8 100%);
    transform: translateY(-1px);
}

.edit-form {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.edit-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 2px solid #ffc107;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 10px;
}

.edit-form .edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.save-edit-btn {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-edit-btn:hover {
    background: linear-gradient(135deg, #e0a800 0%, #dc6502 100%);
    transform: translateY(-1px);
}

.cancel-edit-btn {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-edit-btn:hover {
    background: #6c757d;
    color: white;
}

.confirm-section small {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.confirm-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.confirm-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Animationen für temporäre Nachrichten */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
