/* HGX Web Project - Modern Secure Styles */

/* ===== CSS RESET & BASE STYLES ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #1e3c72;
    --primary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --secondary-color: #0078d7;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Neutral Colors */
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: #e1e5e9;
    --border-light: #f1f3f4;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --shadow-xl: 0 16px 32px rgba(0,0,0,0.2);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Security: Hide elements until JavaScript loads */
.js-hidden {
    visibility: hidden;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
*:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--text-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* ===== INDEX PAGE ===== */
.index-page {
    height: 100vh;
    background: url('background.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.index-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.index-page > * {
    position: relative;
    z-index: 2;
}

.login-btn {
    position: absolute;
    top: var(--space-lg);
    left: var(--space-lg);
    padding: 12px 28px;
    font-size: var(--font-size-md);
    border: none;
    border-radius: var(--radius-md);
    background-color: rgba(30, 60, 114, 0.95);
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.login-btn:hover,
.login-btn:focus {
    background-color: rgba(30, 60, 114, 1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    background: url('background2.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.login-form {
    background: rgba(255, 255, 255, 0.95);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 360px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(20px);
}

.login-form h2 {
    color: var(--primary-color);
    margin: 0 0 var(--space-xl) 0;
    font-size: var(--font-size-2xl);
    font-weight: 600;
}

.login-form input {
    width: 100%;
    margin-bottom: var(--space-md);
    padding: 14px var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    background: rgba(255, 255, 255, 0.9);
    transition: all var(--transition-normal);
    font-family: var(--font-family);
}

.login-form input:focus {
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.1);
}

.login-form input:invalid {
    border-color: var(--error-color);
}

.login-form button {
    width: 100%;
    padding: 14px var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    color: white;
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: var(--space-md);
}

.login-form button:hover,
.login-form button:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-form button:active {
    transform: translateY(0);
}

.security-notice {
    margin-top: var(--space-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.security-notice::before {
    content: "🔒 ";
    margin-right: var(--space-xs);
}

/* ===== WORKSPACE PAGE ===== */
.workspace-page {
    min-height: 100vh;
    background: #f5f7fa;
}

.workspace-page header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 24px 0;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.workspace-page header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 300;
}

.user-info {
    position: absolute;
    top: 24px;
    right: 32px;
    text-align: right;
}

.user-info .logout-btn {
    background: #c62828;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.user-info .logout-btn:hover {
    background: #a71717;
}

.user-info .user-name {
    color: #ffcdd2;
    font-size: 0.9rem;
}

/* ===== NAVIGATION ===== */
.functions-container {
    max-width: 1400px; /* Erweitert von 1200px für mehr Platz */
    margin: 32px auto;
    padding: 0 16px;
}

.ribbon {
    display: flex;
    flex-wrap: nowrap; /* Verhindert Umbruch bei ausreichender Auflösung */
    gap: 8px; /* Reduziert von 12px für kompaktere Darstellung */
    justify-content: center;
    margin-bottom: 32px;
    overflow-x: auto; /* Ermöglicht horizontales Scrollen auf kleineren Bildschirmen */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Webkit Scrollbar Styling für die Ribbon */
.ribbon::-webkit-scrollbar {
    height: 6px;
}

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

.ribbon::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.ribbon::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.ribbon-btn {
    padding: 12px 20px; /* Reduziert von 24px für kompaktere Buttons */
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem; /* Leicht reduziert für bessere Platznutzung */
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px; /* Reduziert von 180px */
    max-width: 200px; /* Begrenzt maximale Breite */
    text-align: center;
    white-space: nowrap; /* Verhindert Textumbruch in Buttons */
    flex-shrink: 0; /* Verhindert Schrumpfung der Buttons */
}

/* Responsive Verhalten für kleinere Bildschirme */
@media (max-width: 1200px) {
    .ribbon {
        flex-wrap: wrap; /* Erlaubt Umbruch auf kleineren Bildschirmen */
        justify-content: center;
    }
    
    .ribbon-btn {
        min-width: 140px; /* Kleinere Mindestbreite auf mobilen Geräten */
        flex-shrink: 1;
    }
}

@media (max-width: 768px) {
    .functions-container {
        max-width: 100%;
        padding: 0 8px;
    }
    
    .ribbon {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .ribbon-btn {
        min-width: 120px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

.ribbon-btn:hover,
.ribbon-btn:focus {
    background: #005fa3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ribbon-btn.active {
    background: #005fa3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ===== RIBBON BUTTON VARIANTS ===== */
.ribbon-btn.btn-danger {
    background: #dc3545;
    color: white;
}

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

.ribbon-btn.btn-danger.active {
    background: #c82333;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.ribbon-btn.btn-warning {
    background: #ffc107;
    color: #212529;
}

.ribbon-btn.btn-warning:hover,
.ribbon-btn.btn-warning:focus {
    background: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.ribbon-btn.btn-success {
    background: #28a745;
    color: white;
}

.ribbon-btn.btn-success:hover,
.ribbon-btn.btn-success:focus {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.ribbon-btn.btn-info {
    background: #17a2b8;
    color: white;
}

.ribbon-btn.btn-info:hover,
.ribbon-btn.btn-info:focus {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* ===== CONTENT SECTIONS ===== */
#workspace-container {
    max-width: 1400px; /* Erweitert von 1200px für Konsistenz */
    margin: 0 auto;
    padding: 0 16px;
}

.workspace-section {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.workspace-section h2 {
    margin: 0 0 24px 0;
    color: #1e3c72;
    font-size: 1.6rem;
    font-weight: 400;
}

/* ===== FORMS ===== */
.workspace-form {
    max-width: 600px;
    margin: 0 auto;
}

.workspace-form label {
    display: block;
    margin-bottom: 16px;
    font-weight: 500;
    color: #333;
}

.workspace-form input[type="text"],
.workspace-form input[type="email"],
.workspace-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 4px;
}

.workspace-form input[type="checkbox"] {
    margin-right: 8px;
}

.workspace-form button {
    background: #0078d7;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.workspace-form button:hover {
    background: #005fa3;
}

/* ===== TABLES ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    color: #333;
    border-bottom: 1px solid #dee2e6;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

/* ===== ALERT & MESSAGE SYSTEM ===== */
.message,
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-weight: 500;
    border-width: 1px;
    border-style: solid;
    display: flex;
    align-items: center;
    position: relative;
    animation: slideIn var(--transition-normal);
}

.message::before,
.alert::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: var(--space-md);
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.message-success,
.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.message-success::before,
.alert-success::before {
    content: "✓";
    background: none;
    color: var(--success-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-error,
.alert-error,
.message-danger,
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.message-error::before,
.alert-error::before,
.message-danger::before,
.alert-danger::before {
    content: "⚠";
    background: none;
    color: var(--error-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-warning,
.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.message-warning::before,
.alert-warning::before {
    content: "⚠";
    background: none;
    color: var(--warning-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-info,
.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.message-info::before,
.alert-info::before {
    content: "ℹ";
    background: none;
    color: var(--info-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Security-specific alerts */
.alert-security {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
    border-width: 2px;
}

.alert-security::before {
    content: "🔒";
    font-size: var(--font-size-lg);
}

/* Dismissible alerts */
.alert-dismissible {
    padding-right: 50px;
}

.alert-dismiss {
    position: absolute;
    top: 50%;
    right: var(--space-md);
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: var(--font-size-lg);
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.alert-dismiss:hover {
    opacity: 1;
}

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

/* ===== RESPONSIVE DESIGN & MODERN IMPROVEMENTS ===== */
@container (max-width: 768px) {
    .workspace-section {
        padding: var(--space-lg);
    }
}

/* Mobile-first responsive design */
@media (max-width: 480px) {
    :root {
        --space-md: 12px;
        --space-lg: 16px;
        --space-xl: 24px;
        --font-size-md: 0.9rem;
    }
    
    .login-form {
        padding: var(--space-lg);
        min-width: 280px;
    }
    
    .ribbon {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ribbon-btn {
        min-width: auto;
        width: 100%;
    }
    
    .workspace-section {
        margin: var(--space-md);
        padding: var(--space-md);
    }
    
    .user-info {
        position: static;
        margin-top: var(--space-md);
        text-align: center;
    }
    
    .data-table {
        font-size: var(--font-size-sm);
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .data-table th,
    .data-table td {
        padding: var(--space-sm) var(--space-md);
        min-width: 120px;
    }
    
    .workspace-form {
        padding: 0;
    }
    
    .workspace-form input,
    .workspace-form select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 768px) {
    .functions-container {
        padding: 0 var(--space-md);
    }
    
    .ribbon {
        gap: var(--space-sm);
    }
    
    .ribbon-btn {
        padding: 10px 16px;
        font-size: var(--font-size-sm);
        min-width: 160px;
    }
    
    .workspace-section {
        padding: var(--space-lg);
    }
    
    .workspace-section h2 {
        font-size: var(--font-size-xl);
    }
    
    .data-table {
        font-size: var(--font-size-sm);
    }
    
    .login-btn {
        top: var(--space-md);
        left: var(--space-md);
        padding: 10px 20px;
        font-size: var(--font-size-sm);
    }
}

@media (max-width: 1024px) {
    .workspace-page header h1 {
        font-size: var(--font-size-xl);
    }
    
    .user-info {
        right: var(--space-lg);
    }
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-form,
    .workspace-section {
        border: 1px solid rgba(0,0,0,0.05);
    }
}

/* Dark mode support (respects user preference) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --text-light: #999999;
        --border-color: #404040;
        --border-light: #333333;
    }
    
    .login-form {
        background: rgba(45, 45, 45, 0.95);
        color: var(--text-primary);
    }
    
    .login-form h2 {
        color: var(--text-primary);
    }
    
    .workspace-section {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    
    .data-table th {
        background: #404040;
        color: var(--text-primary);
    }
    
    .data-table tr:hover {
        background: #404040;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .user-info,
    .ribbon,
    .login-btn,
    .logout-btn {
        display: none !important;
    }
    
    .workspace-section {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Focus management for better accessibility */
.workspace-section:focus-within {
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(0, 120, 215, 0.1);
}

/* Improved form validation styles */
.form-field {
    position: relative;
    margin-bottom: var(--space-md);
}

.form-field.has-error input {
    border-color: var(--error-color);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.form-field.has-success input {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
}

.field-error {
    color: var(--error-color);
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
    display: block;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Modern scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Improved selection styling */
::selection {
    background: rgba(0, 120, 215, 0.2);
    color: var(--text-primary);
}

/* Bewertungsskala Styles für User Profile */
.bewertung-container {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.current-settings {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0078d7;
}

.current-settings h4 {
    margin: 0 0 15px 0;
    color: #0078d7;
}

.scale-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.scale-range {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.default-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}

.custom-badge {
    background: #ffc107;
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}

.last-updated {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

.settings-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.settings-form h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.bewertung-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.bewertung-form .form-group {
    display: flex;
    flex-direction: column;
}

.bewertung-form label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.bewertung-form input[type="number"] {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.bewertung-form input[type="number"]:focus {
    outline: none;
    border-color: #0078d7;
}

.bewertung-form small {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background: #0078d7;
    color: white;
}

.btn-primary:hover {
    background: #106ebe;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.attribute-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.attribute-preview h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.attribute-grid {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

.position-group {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.position-group h5 {
    margin: 0 0 10px 0;
    color: #0078d7;
    font-weight: bold;
}

.attribute-list {
    display: grid;
    gap: 8px;
}

.attribute-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0078d7;
}

.attribute-name {
    font-weight: 500;
    color: #333;
}

.attribute-range {
    font-weight: bold;
    color: #0078d7;
    font-size: 0.9em;
}

.no-attributes {
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin-top: 20px;
}

.no-attributes p {
    margin: 0 0 10px 0;
    color: #856404;
}

.no-attributes code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #333;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bewertung-form .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .scale-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ===== RESPONSIVE DESIGN & MODERN IMPROVEMENTS ===== */
@media (max-width: 1200px) {
    .workspace-section {
        padding: var(--space-lg);
    }
}

@media (max-width: 992px) {
    .ribbon {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .ribbon-btn {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .login-form {
        padding: var(--space-lg);
        margin: var(--space-md);
    }
    
    .workspace-container {
        padding: var(--space-md);
    }
    
    .table-responsive {
        font-size: var(--font-size-sm);
    }
    
    .button-group {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

@media (max-width: 576px) {
    .login-form h1 {
        font-size: 1.5rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* ===== USER PROFILE STYLES ===== */
.sub-nav {
    display: flex;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 24px;
    gap: 4px;
    overflow-x: auto;
}

.sub-nav-item {
    flex: 1;
    min-width: max-content;
    padding: 12px 16px;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.sub-nav-item:hover {
    background: #e9ecef;
    color: #495057;
}

.sub-nav-item.active {
    background: #0078d7;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 120, 215, 0.3);
}

.tab-content {
    min-height: 400px;
}

.settings-grid {
    display: grid;
    gap: 24px;
    max-width: 1000px;
}

.settings-card {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.settings-card h3 {
    margin: 0 0 20px 0;
    color: #0078d7;
    font-size: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #0078d7;
    box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.1);
}

.form-input.disabled {
    background: #f8f9fa;
    color: #6c757d;
}

.form-help {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-top: 4px;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.status.inactive {
    color: #6c757d;
    font-weight: bold;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

.info-box {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.info-box.warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.info-box.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* User Profile Responsive Design */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .sub-nav {
        flex-direction: column;
    }
    
    .sub-nav-item {
        text-align: left;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== MANDANT ADMIN STYLES ===== */
.mandant-admin-container {
    max-width: 600px;
    margin: 0 auto;
}

.activation-info-box {
    background: #e3f2fd;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #2196f3;
    margin-top: 24px;
}

.activation-info-box h4 {
    margin: 0 0 8px 0;
    color: #1976d2;
}

.activation-info-box p {
    margin: 0;
    font-size: 0.9rem;
}

.no-users-message {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
}

.warning-notice {
    background: #fff3cd;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    margin-bottom: 24px;
}

.warning-notice h4 {
    margin: 0 0 8px 0;
    color: #856404;
}

.warning-notice p {
    margin: 0;
}

.user-role-badge.global-admin {
    color: #dc3545;
    font-weight: bold;
}

.user-role-badge.mandant-admin {
    color: #0078d7;
    font-weight: bold;
}

.user-role-badge.trainer {
    color: #28a745;
}

.user-role-badge.user {
    color: #6c757d;
}

.current-user-indicator {
    color: #007bff;
    font-weight: bold;
}

/* ===== ACTIVATION PAGES STYLES ===== */
.activation-link {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 32px;
    background: #005fa3;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
}

.activation-link:hover {
    background: #004a82;
    color: #fff;
}

.error-message {
    color: red;
}

.success-message {
    color: green;
    font-size: 1.2em;
}

/* ===== PASSWORD CHANGE CONFIRMATION PAGE ===== */
.password-change-body {
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.password-change-container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 30px;
    margin: 100px auto;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.password-change-logo {
    text-align: center;
    margin-bottom: 30px;
}

.password-change-logo h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.password-form-group {
    margin-bottom: 20px;
}

.password-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.password-form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.password-form-group input:focus {
    border-color: #3498db;
    outline: none;
}

.password-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.password-btn:hover {
    background: linear-gradient(45deg, #2980b9, #1c6ea4);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.password-error {
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.password-success {
    background-color: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.password-back-link {
    text-align: center;
    margin-top: 20px;
}

.password-back-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.password-back-link a:hover {
    text-decoration: underline;
}

.password-requirements {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
}

.password-requirements h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.password-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.password-requirements li {
    margin-bottom: 5px;
    color: #6c757d;
}

/* ===== ERROR PAGE STYLES ===== */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: var(--space-lg);
}

.error-container {
    background: var(--bg-secondary);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.error-code {
    font-size: 4rem;
    font-weight: 700;
    color: var(--error-color);
    margin-bottom: var(--space-md);
}

.error-title {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.error-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-normal);
    display: inline-block;
}

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

.error-btn.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.error-btn.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}

.error-btn.btn-secondary:hover {
    background: var(--hover-color);
}

/* ===== WORKSPACE DYNAMIC BACKGROUND ===== */
.workspace-page.dynamic-bg {
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
}

.workspace-logout-form {
    margin: 0;
}

/* ===== USER ACTIVATION PAGE ===== */
.activation-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.activation-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.activation-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.success-icon {
    color: #28a745;
}

.error-icon {
    color: #dc3545;
}

.activation-title {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: #333;
}

.activation-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 30px;
}

.activation-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.activation-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.activation-btn-primary {
    background: #007bff;
    color: white;
}

.activation-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.activation-btn-secondary {
    background: #6c757d;
    color: white;
}

.activation-btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

.activation-error-container {
    text-align: center;
    margin-top: 40px;
}

.activation-error-text {
    color: red;
}

.activation-success-text {
    color: green;
    font-size: 1.2em;
}

.activation-login-btn {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 32px;
    background: #005fa3;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
}

/* ===== MANDANT ADMIN INLINE STYLES ===== */
.mandant-admin-ribbon {
    margin-bottom: 32px;
}

.mandant-admin-container {
    max-width: 600px;
    margin: 0 auto;
}

.mandant-admin-info-box {
    background: #e3f2fd;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #2196f3;
    margin-top: 24px;
}

.mandant-admin-info-title {
    margin: 0 0 8px 0;
    color: #1976d2;
}

.mandant-admin-info-text {
    margin: 0;
    font-size: 0.9rem;
}

.mandant-admin-empty {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mandant-admin-warning {
    background: #fff3cd;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    margin-bottom: 24px;
}

.mandant-admin-warning-title {
    margin: 0 0 8px 0;
    color: #856404;
}

.mandant-admin-warning-text {
    margin: 0;
}

.mandant-admin-actions-col {
    width: 140px;
}

.mandant-admin-global-admin {
    color: #dc3545;
    font-weight: bold;
}

/* ===== LOGIN BUTTON ADJUSTMENTS ===== */
.login-btn-centered {
    display: inline-block;
    margin-top: 16px;
    text-decoration: none;
    text-align: center;
}
