:root {
    /* Dunkelgrün mit Orange Akzenten */
    --bg-primary: #0d1f1a;
    --bg-secondary: #1a2e27;
    --bg-tertiary: #0a1914;
    --bg-card: #1e3a30;
    
    --accent-primary: #ff8c42;
    --accent-secondary: #ff7020;
    --accent-tertiary: #ffa366;
    --accent-glow: rgba(255, 140, 66, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --text-muted: #7e7e9a;
    
    --success: #26de81;
    --warning: #fed330;
    --danger: #fc5c65;
    --danger-glow: rgba(252, 92, 101, 0.3);
    
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-color: rgba(255, 255, 255, 0.1);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Logo Link oben links */
.logo-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    opacity: 0.8;
}

.logo-link:hover {
    transform: scale(1.05);
    opacity: 1;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.auth-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.app-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px var(--danger-glow);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--danger-glow);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-card);
}

.btn-icon:active {
    transform: scale(0.95);
}

.error-message,
.message {
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.error-message {
    background: rgba(252, 92, 101, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.message.success {
    background: rgba(38, 222, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
    display: block;
}

.message.error {
    background: rgba(252, 92, 101, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
    display: block;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* App Container */
.app-container {
    min-height: 100vh;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

.app-header {
    background: var(--bg-card);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Header actions group: right-aligned buttons side-by-side */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Profile dropdown */
.profile-menu {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    padding: 8px;
    display: none;
    z-index: 150;
}

.dropdown-item {
    display: block;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

/* Show on hover/focus for desktop */
.profile-menu:hover .dropdown-menu,
.profile-menu:focus-within .dropdown-menu {
    display: block;
}

/* Notes List */
.notes-list {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.add-note-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px var(--accent-glow);
    transition: all var(--transition-fast);
}

.add-note-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.add-note-btn:active {
    transform: translateY(0);
}

#notesContainer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.note-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.note-card:active {
    transform: translateX(2px);
}

.note-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.note-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-card-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Note Detail */
.note-detail {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-secondary);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    z-index: 200;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.note-detail.active {
    transform: translateX(0);
}

.note-detail-header {
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.note-title-input {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.note-title-input:focus {
    outline: none;
    border-bottom-color: var(--accent-primary);
}

.note-content-input {
    flex: 1;
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    resize: none;
    font-family: inherit;
}

.note-content-input:focus {
    outline: none;
}

/* Profile */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.profile-section {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.profile-section h2 {
    text-align: center;
    margin-bottom: 8px;
}

.profile-section h3 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.danger-zone {
    border: 2px solid var(--danger);
    background: rgba(252, 92, 101, 0.1);
}

.danger-zone h3 {
    color: var(--danger);
}

.danger-warning {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.admin-section {
    border: 2px solid var(--accent-primary);
    background: rgba(255, 140, 66, 0.1);
}

.admin-section h3 {
    color: var(--accent-primary);
}

.users-list {
    margin-top: 16px;
}

.user-card {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.user-info h4 {
    margin-bottom: 4px;
    color: var(--text-primary);
}

.user-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-pin {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: all var(--transition-fast);
    color: var(--text-muted);
}

.btn-pin:hover {
    transform: scale(1.2);
}

.btn-pin.pinned {
    color: var(--accent-primary);
}

.note-card.pinned {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 140, 66, 0.05));
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.note-dates {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.note-dates span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--border-radius);
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-content h3 {
    margin-bottom: 16px;
    color: var(--danger);
}

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

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.modal-buttons .btn {
    width: auto;
    flex: 1;
}

/* Demo Mode Styles */
.demo-hint {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.demo-hint p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.btn-demo {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

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

.demo-banner {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 12px 20px;
    box-shadow: var(--shadow-sm);
}

.demo-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-small {
    padding: 6px 16px;
    font-size: 0.85rem;
    background: white;
    color: var(--accent-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-small:hover {
    transform: scale(1.05);
}

/* Responsive */
@media (min-width: 768px) {
    .note-detail {
        width: 500px;
    }
}

/* Touch Feedback */
@media (hover: none) {
    .btn:active,
    .btn-icon:active,
    .note-card:active {
        opacity: 0.7;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Footer */
.app-footer {
    background: rgba(13, 31, 26, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition-fast);
}

.footer-content a:hover {
    color: var(--text-secondary);
}

/* Legal Pages */
.legal-container {
    max-width: 800px;
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 32px;
    margin: 20px auto;
    box-shadow: var(--shadow-lg);
}

.legal-header {
    margin-bottom: 32px;
}

.legal-header h1 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 8px;
}

.back-link {
    display: inline-block;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 16px;
    transition: transform var(--transition-fast);
}

.back-link:hover {
    transform: translateX(-4px);
}

.legal-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.legal-section {
    margin-bottom: 32px;
}

.legal-section h2 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 16px;
    margin-top: 24px;
}

.legal-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 12px;
    margin-top: 20px;
}

.legal-section p {
    margin-bottom: 12px;
}

.legal-section ul {
    margin-left: 24px;
    margin-bottom: 12px;
}

.legal-section li {
    margin-bottom: 8px;
}

