html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Legal Page Modal Styles */
.legal-page {
    color: #333;
    line-height: 1.6;
}

.legal-page h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #3498db;
}

.legal-page h2 {
    color: #34495e;
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-page h3 {
    color: #555;
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.legal-page p, .legal-page li {
    color: #666;
    margin-bottom: 0.8rem;
}

.legal-page a {
    color: #3498db;
    text-decoration: underline;
}

.legal-page a:hover {
    color: #2980b9;
}

.legal-page .highlight-box {
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    border-left: 4px solid;
}

.legal-page .highlight-box.info {
    background: #e8f4fd;
    border-left-color: #3498db;
    color: #2c3e50;
}

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

.legal-page .highlight-box.important {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

/* Responsive adjustments for legal modals */
@media (max-width: 768px) {
    .legal-modal-content {
        width: 95% !important;
        margin: 1rem !important;
    }
    
    .legal-modal-header {
        padding: 1rem !important;
    }
    
    .legal-modal-body {
        padding: 1rem !important;
    }
    
    .legal-page h1 {
        font-size: 1.5rem;
    }
    
    .legal-page h2 {
        font-size: 1.2rem;
    }
}

/* Password Change Modal Styles */
.password-change-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-change-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.password-change-modal .modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 10001;
}

.password-change-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.password-change-modal .modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.password-change-modal .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.password-change-modal .modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.password-change-modal .modal-body {
    padding: 20px;
}

.password-change-modal .form-group {
    margin-bottom: 15px;
}

.password-change-modal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.password-change-modal .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.password-change-modal .form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.password-change-modal .password-strength {
    margin-top: 10px;
    color: #666;
    font-size: 12px;
}

.password-change-modal .modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.password-change-modal .btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.password-change-modal .btn-secondary:hover {
    background-color: #5a6268;
}

.password-change-modal .btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.password-change-modal .btn-primary:hover {
    background-color: #0056b3;
}

.password-change-modal .btn-primary:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* Loading spinner animation */
.spinning {
    animation: spin 1s linear infinite;
}

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

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--background-color);
}

/* Header Styles - DMS Style */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left .app-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-left .app-subtitle {
    display: none;
}

.header-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-language-switcher {
    margin-right: 1rem;
}

/* Login page language switcher */
.login-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.login-language-switcher {
    /* Smaller version for login page */
}

.login-language-switcher .language-switcher-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 13px;
    padding: 6px 10px;
}

.header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    margin-right: 1rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.user-account {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #333;
}

.user-greeting {
    color: #666;
    font-weight: 400;
}

.username {
    color: #333;
    font-weight: 600;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

/* Main Layout */
.main-layout {
    display: block;
    flex: 1;
    width: 100%;
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: var(--spacing-xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(248, 249, 250, 0.9));
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    padding: var(--spacing-md);
    border: 1px solid rgba(233, 236, 239, 0.5);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.sidebar-section:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.sidebar-section-title {
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 var(--spacing-md) 0;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    border-radius: var(--border-radius-small);
    text-align: center;
    position: relative;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.2);
}

.sidebar-section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: var(--border-radius-small);
    pointer-events: none;
}

.sidebar-section-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.content {
    flex-grow: 1;
    width: 100%;
    max-width: 100%;
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
    min-height: calc(100vh - 120px);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .main-layout {
        display: block;
        width: 100%;
    }
    
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: var(--transition-slow);
        z-index: 999;
        height: 100vh;
        width: 280px;
        left: 0;
        top: 0;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .content {
        padding: var(--spacing-md);
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .header-left .app-title {
        font-size: 1.3rem;
    }
}

.sidebar {
    padding: var(--spacing-xl);
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-header {
    width: 100%;
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.sidebar-section {
    width: 100%;
    margin-bottom: var(--spacing-xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 250, 0.95));
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    padding: var(--spacing-md);
    border: 1px solid rgba(233, 236, 239, 0.6);
    transition: var(--transition);
}

.sidebar-section-title {
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 var(--spacing-md) 0;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    border-radius: var(--border-radius-small);
    text-align: center;
    position: relative;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.2);
}

.content {
    flex-grow: 1;
    width: 100%;
    max-width: 100%;
    padding: 20px;
}

/* Login Button in Header */
.login-btn.logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.login-btn.logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.login-status-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #6c757d;
}

.login-status-icon {
    font-size: 16px;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

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

.login-btn-icon {
    font-size: 16px;
}

.login-btn.logout {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.login-btn.logout:hover {
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

/* Enhanced Login Form Container */
.login-form-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.login-form-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    margin: 20px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.login-form-container:not([style*="display: none"]) .login-form-card {
    transform: scale(1);
}

.login-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.login-form-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.login-form-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.login-form-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.login-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.login-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-form-group input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.login-form-group input::placeholder {
    color: #6c757d;
}

#loginForm {
    padding: 24px;
}

.login-form-actions {
    margin-top: 30px;
}

.login-form-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.login-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

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

.login-form-submit-icon {
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-button-container {
        top: 10px;
        right: 10px;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
    
    .login-status-wrapper {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .login-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .login-form-card {
        margin: 10px;
    }
    
    .login-form-header, #loginForm {
        padding: 16px;
    }
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
}

.notification.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.notification.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.notification.info {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 16px;
}

/* Management System Styles */
.management-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.management-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 2rem;
}

.management-stats {
    display: flex;
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.management-actions {
    display: flex;
    gap: 15px;
}

/* User Management Styles */
.user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.user-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.user-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-right: 15px;
}

.user-info {
    flex: 1;
}

.user-info h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.user-email {
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.user-id {
    color: #6c757d;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.user-groups-section {
    margin-bottom: 15px;
}

.user-groups-section h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1rem;
}

.user-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.group-badge {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.no-groups {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

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

/* Group Management Styles */
.group-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.group-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.group-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.group-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-right: 15px;
}

.group-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: white;
}

.logo-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.logo-selection select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.logo-preview-image {
    max-width: 120px;
    max-height: 80px;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    border: 2px solid #e9ecef;
    background: white;
}

.no-logo {
    color: #666;
    font-style: italic;
}

.group-info {
    flex: 1;
}

.group-info h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.group-description {
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.group-id {
    color: #6c757d;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.group-members-section {
    margin-bottom: 15px;
}

.group-members-section h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1rem;
}

.group-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-badge {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.no-members {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

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

/* Dialog Styles */
.management-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.dialog-content {
    background: white;
    border-radius: 12px;
    min-width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.dialog-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.dialog-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.dialog-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.dialog-body {
    padding: 20px;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Modern Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1565c0);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--text-secondary), #5a6268);
    color: var(--text-light);
    box-shadow: var(--shadow-light);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: var(--text-light);
    box-shadow: var(--shadow-light);
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-dark), #2e7d32);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-1px);
}

.btn-small {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
}

.btn-large {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.1rem;
}

/* Status Indicators */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-small);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-completed {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.status-progress {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #2196f3;
}

.status-pending {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ff9800;
}

.status-error {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #f44336;
}

/* Loading States */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: var(--spacing-md) auto;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-text {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: var(--spacing-sm);
}

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

/* Loading overlay for cards */
.memory-card.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

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

/* Footer Styles */
.app-footer {
    margin-top: auto;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: var(--text-light);
    padding: var(--spacing-xxl) var(--spacing-xl) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
}

.footer-section h4 {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-md) 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-color);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--text-light);
    transform: translateX(4px);
}

.footer-contact-link {
    color: #ffffff !important;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.footer-contact-link:hover {
    color: #f8f9fa !important;
    text-decoration-color: #ffffff;
    transform: translateX(2px);
}

.footer-bottom {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin: 0;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .app-footer {
        padding: var(--spacing-xl) var(--spacing-md) var(--spacing-lg);
    }
}

/* Legal Pages Styles */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    line-height: 1.7;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.legal-page h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: var(--spacing-md);
}

.legal-page h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: var(--spacing-xl) 0 var(--spacing-md) 0;
    border-left: 4px solid var(--primary-color);
    padding-left: var(--spacing-md);
}

.legal-page h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
}

.legal-page h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: var(--spacing-md) 0 var(--spacing-sm) 0;
}

.legal-page p {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.legal-page ul, .legal-page ol {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-xl);
}

.legal-page li {
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.legal-page a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.legal-page a:hover {
    text-decoration: underline;
}

.last-updated {
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background-color);
    border-radius: var(--border-radius);
}

/* Tables */
.cookie-table, .refund-table, .sanctions-table, .service-hours {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.cookie-table th, .refund-table th, .sanctions-table th, .service-hours th {
    background: var(--primary-color);
    color: var(--text-light);
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
}

.cookie-table td, .refund-table td, .sanctions-table td, .service-hours td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.cookie-table tr:nth-child(even), .refund-table tr:nth-child(even), 
.sanctions-table tr:nth-child(even), .service-hours tr:nth-child(even) {
    background: var(--background-color);
}

.cookie-table code {
    background: var(--background-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-small);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Special Components */
.contact-card {
    background: var(--background-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin: var(--spacing-md) 0;
    border-left: 4px solid var(--primary-color);
}

.cookie-category {
    margin: var(--spacing-md) 0;
}

.cookie-controls {
    background: var(--background-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin: var(--spacing-md) 0;
}

.cookie-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
    cursor: pointer;
}

.cookie-slider {
    width: 50px;
    height: 24px;
    background: var(--text-secondary);
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
}

.cookie-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

input[type="checkbox"]:checked + .cookie-slider {
    background: var(--primary-color);
}

input[type="checkbox"]:checked + .cookie-slider::before {
    transform: translateX(26px);
}

.withdrawal-form {
    background: var(--background-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin: var(--spacing-md) 0;
}

.form-template {
    background: var(--surface-color);
    padding: var(--spacing-lg);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
}

.faq-item {
    background: var(--background-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin: var(--spacing-md) 0;
    border-left: 4px solid var(--accent-color);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-top: 0;
}

/* Grid Layouts */
.support-channels, .special-contacts, .features-grid, .team-grid, .stats-grid {
    display: grid;
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.support-channels {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.special-contacts {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.support-channel, .contact-category, .feature-card, .team-member, .stat-card {
    background: var(--surface-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border-top: 4px solid var(--primary-color);
}

.feature-card h3, .team-member h3, .stat-card h3 {
    color: var(--primary-color);
    margin-top: 0;
}

/* Timeline */
.timeline {
    position: relative;
    padding: var(--spacing-lg) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item {
    position: relative;
    margin: var(--spacing-xl) 0;
    padding-left: var(--spacing-xxl);
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-lg) var(--spacing-xxl);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: var(--spacing-lg);
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--surface-color);
}

.timeline-item h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
}

/* Awards */
.awards {
    display: grid;
    gap: var(--spacing-md);
}

.award {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: var(--text-light);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    text-align: center;
}

.award h3 {
    color: var(--text-light);
    margin-top: 0;
    font-size: 1.3rem;
}

/* Sustainability */
.sustainability {
    background: var(--background-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin: var(--spacing-md) 0;
}

.sustainability h3 {
    color: var(--accent-color);
    margin-top: var(--spacing-md);
}

.sustainability h3:first-child {
    margin-top: 0;
}

/* Feedback Options */
.feedback-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.feedback-option {
    background: var(--surface-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border-left: 4px solid var(--accent-color);
}

.feedback-option h4 {
    color: var(--accent-color);
    margin-top: 0;
}

/* Location Info */
.location-info {
    background: var(--background-color);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin: var(--spacing-md) 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .legal-page {
        padding: var(--spacing-md);
    }
    
    .legal-page h1 {
        font-size: 2rem;
    }
    
    .legal-page h2 {
        font-size: 1.3rem;
    }
    
    .support-channels, .special-contacts, .features-grid, .team-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .timeline::before {
        left: 15px;
    }
    
    .timeline-item {
        padding-left: var(--spacing-xl);
    }
    
    .timeline-item::before {
        left: -19px;
    }
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

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

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.loading-spinner {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

.error {
    color: #dc3545;
    font-size: 0.9rem;
}

/* Responsive Design for Management */
@media (max-width: 768px) {
    .management-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .management-stats {
        justify-content: center;
    }
    
    .management-actions {
        justify-content: center;
    }
    
    .user-list,
    .group-list {
        grid-template-columns: 1fr;
    }
    
    .dialog-content {
        min-width: 90vw;
        margin: 20px;
    }
    
    .user-actions,
    .group-actions {
        justify-content: center;
    }
}

/* Group Members Management Dialog */
.group-members-dialog,
.user-groups-dialog,
.user-details-dialog {
    min-width: 800px;
    max-width: 95vw;
}

.members-management-container,
.groups-management-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.current-members-section,
.available-users-section,
.current-groups-section,
.available-groups-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.current-members-section h4,
.available-users-section h4,
.current-groups-section h4,
.available-groups-section h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.users-search,
.groups-search {
    margin-bottom: 15px;
}

.users-search input,
.groups-search input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.users-search input:focus,
.groups-search input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.members-list,
.users-list,
.groups-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: white;
}

.member-item,
.user-item,
.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.member-item:last-child,
.user-item:last-child,
.group-item:last-child {
    border-bottom: none;
}

.member-item:hover,
.user-item:hover,
.group-item:hover {
    background-color: #f8f9fa;
}

.member-info,
.user-info,
.group-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.member-avatar,
.user-avatar,
.group-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.member-details,
.user-details,
.group-details {
    flex: 1;
}

.member-name,
.user-name,
.group-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 2px;
}

.member-email,
.user-email,
.group-description {
    color: #6c757d;
    font-size: 0.9rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

.btn-small .material-icons {
    font-size: 16px;
}

.no-members,
.no-users,
.no-groups {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 30px;
    background: white;
    border-radius: 6px;
}

.group-required {
    padding: 6px 12px;
    font-size: 12px;
    background: linear-gradient(135deg, #FFC107 0%, #FF8F00 100%);
    color: #212529;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* User Details Dialog */
.user-details-dialog {
    min-width: 700px;
}

.user-details-container {
    padding: 20px 0;
}

.user-details-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.user-details-avatar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
}

.details-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.details-avatar-info h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.user-details-id {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.user-details-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.details-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.details-section h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.details-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.details-row:last-child {
    border-bottom: none;
}

.details-label {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

.details-value {
    color: #2c3e50;
    text-align: right;
    flex: 1;
}

.details-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.details-group-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.details-group-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.details-group-info {
    flex: 1;
}

.details-group-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 2px;
}

.details-group-description {
    color: #6c757d;
    font-size: 0.9rem;
}

.group-required-small {
    padding: 4px 8px;
    font-size: 11px;
    background: linear-gradient(135deg, #FFC107 0%, #FF8F00 100%);
    color: #212529;
    border-radius: 4px;
    font-weight: 600;
}

.no-groups-details {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.details-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive Design for Members Management */
@media (max-width: 768px) {
    .group-members-dialog,
    .user-groups-dialog,
    .user-details-dialog {
        min-width: 95vw;
    }
    
    .members-management-container,
    .groups-management-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .member-item,
    .user-item,
    .group-item {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .member-info,
    .user-info,
    .group-info {
        justify-content: center;
    }
    
    .user-details-avatar {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .details-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .details-value {
        text-align: left;
    }
    
    .details-actions {
        justify-content: center;
    }
}

/* Login Form Loading State */
.login-form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Enhanced focus styles */
.login-form-group input:focus,
.login-btn:focus,
.login-form-submit:focus,
.login-form-close:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* Duplicate User Dialog */
.duplicate-user-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    backdrop-filter: blur(5px);
}

.duplicate-user-dialog-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 90%;
    overflow: hidden;
    animation: dialogSlideIn 0.3s ease-out;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0px) scale(1);
    }
}

.duplicate-user-dialog-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 20px 24px;
    text-align: center;
}

.duplicate-user-dialog-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.duplicate-user-dialog-body {
    padding: 24px;
    text-align: center;
}

.duplicate-user-dialog-body p {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 16px;
    line-height: 1.5;
}

.duplicate-user-dialog-body p:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: #667eea;
}

.duplicate-user-dialog-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px 24px;
}

.duplicate-user-dialog-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.duplicate-user-dialog-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.duplicate-user-dialog-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.duplicate-user-dialog-btn.secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.duplicate-user-dialog-btn.secondary:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
}

/* Responsive Design for Dialog */
@media (max-width: 768px) {
    .duplicate-user-dialog-content {
        max-width: 350px;
    }
    
    .duplicate-user-dialog-header,
    .duplicate-user-dialog-body {
        padding: 16px 20px;
    }
    
    .duplicate-user-dialog-actions {
        flex-direction: column;
        padding: 0 20px 20px 20px;
    }
    
    .duplicate-user-dialog-btn {
        padding: 14px 16px;
    }
}

/* Fullscreen Login Mask */
.fullscreen-login-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    overflow: hidden;
}

.fullscreen-login-mask::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
}

@keyframes backgroundFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.fullscreen-login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: loginMaskSlideIn 0.5s ease-out;
}

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

.fullscreen-login-header {
    margin-bottom: 30px;
}

/* Form Toggle Buttons */
.form-toggle-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
}

.form-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
}

.form-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.form-toggle-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.form-toggle-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.form-toggle-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.form-toggle-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.form-toggle-description {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
    line-height: 1.2;
    color: #666;
}

.form-toggle-btn.active .form-toggle-description {
    opacity: 1;
}

.fullscreen-login-header h1 {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.fullscreen-login-header p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 400;
}

.fullscreen-login-form {
    text-align: left;
}

.fullscreen-login-group {
    margin-bottom: 25px;
}

.fullscreen-login-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.fullscreen-login-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: white;
}

.fullscreen-login-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.fullscreen-login-group input::placeholder {
    color: #6c757d;
    font-weight: 400;
}

.fullscreen-login-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    margin-top: 20px;
}

.fullscreen-login-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.fullscreen-login-submit:active {
    transform: translateY(-1px);
}

.fullscreen-login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.fullscreen-login-submit-icon {
    font-size: 20px;
}

/* Authenticated Container */
.authenticated-container {
    display: none;
    min-height: 100vh;
}

.authenticated-container.show {
    display: block;
}

.fullscreen-login-mask.hide {
    display: none;
}

/* Responsive Design for Fullscreen Login */
@media (max-width: 768px) {
    .fullscreen-login-container {
        padding: 30px 20px;
        max-width: 350px;
    }
    
    .fullscreen-login-header h1 {
        font-size: 2rem;
    }
    
    .fullscreen-login-header p {
        font-size: 1rem;
    }
    
    .form-toggle-btn {
        padding: 12px 16px;
        min-height: 70px;
    }
    
    .form-toggle-icon {
        font-size: 18px;
    }
    
    .form-toggle-title {
        font-size: 14px;
    }
    
    .form-toggle-description {
        font-size: 11px;
    }
    
    .fullscreen-login-group input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .fullscreen-login-submit {
        padding: 15px 20px;
        font-size: 16px;
    }
}

.sidebar h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--primary-color);
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
}

.sidebar li {
    margin-bottom: var(--spacing-xs);
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.sidebar a {
    text-decoration: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    margin: 2px 0;
    border-radius: var(--border-radius-small);
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(233, 236, 239, 0.3);
    backdrop-filter: blur(5px);
}

.sidebar a:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    transform: translateX(4px);
    box-shadow: var(--shadow-light);
    border-color: var(--primary-color);
}

.sidebar ul ul {
    padding-left: 0;
    display: none;
    width: 100%;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: rgba(248, 249, 250, 0.4);
    border-radius: var(--border-radius-small);
    border: 1px solid rgba(233, 236, 239, 0.4);
}

.sidebar ul ul a {
    background: rgba(255, 255, 255, 0.5);
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    padding-left: var(--spacing-lg);
}

.sidebar ul ul a:hover {
    border-left-color: var(--primary-color);
    transform: translateX(2px);
}

.sidebar ul li.active > ul {
    display: block;
}

.sidebar ul li.has-submenu > a::after {
    content: "▾";
    margin-left: auto;
    font-size: 0.8rem;
    transition: var(--transition);
    color: var(--primary-color);
}

.sidebar ul li.has-submenu.active > a::after {
    content: "▴";
    transform: rotate(0deg);
}

.sidebar ul li.has-submenu > a:hover::after {
    color: var(--text-light);
}

.topic-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.topic-table th, .topic-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.topic-table th {
    background-color: #f5f5f5;
}

.image-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.image-table th, .image-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.image-table th {
    background-color: #f5f5f5;
}

.action-buttons button {
    margin-right: 5px;
    padding: 5px 10px;
    border-style: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-button {
    background-color: #4CAF50;
    color: white;
}

.delete-button {
    background-color: #f44336;
    color: white;
}

.new-topic-button {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border-style: none;
    border-radius: 4px;
    margin-bottom: 20px;
    cursor: pointer;
}

.new-image-button {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border-style: none;
    border-radius: 4px;
    margin-bottom: 20px;
    cursor: pointer;
}

.edit-input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 5px;
}

.save-button {
    background-color: #4CAF50;
    color: white;
    border-style: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    margin-right: 5px;
}

.save-new-button {
    background-color: #4CAF50;
    color: white;
    border-style: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    margin-right: 5px;
}

.cancel-button {
    background-color: #f44336;
    color: white;
    border-style: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

.upload-container {
    margin: 20px 0px;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5ch;
    padding: 8px 16px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.upload-button:hover {
    background-color: #1976D2;
}

.upload-button .material-icons {
    font-size: 20px;
}

.thumbnail-container {
    position: relative;
    display: inline-block;
}

.thumbnail-preview {
    display: block;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.download-button {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.8;
}

.download-button:hover {
    opacity: 1.0;
}

.download-button .material-icons {
    font-size: 16px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.memory-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.memory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-100%);
    transition: var(--transition);
}

.memory-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-light);
}

.memory-card:hover::before {
    transform: translateX(0);
}

.card-topic {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-question {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius-small);
    border-left: 4px solid var(--primary-color);
    font-weight: 500;
}

.card-unterlage {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius-small);
    border-left: 4px solid var(--accent-color);
    word-break: break-word;
    font-weight: 500;
}

.card-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-answer {
    padding: 8px;
    background-color: #e3f2fd;
    border-radius: 5px;
    max-height: 80px; /* Oder eine andere gewünschte maximale Höhe */
    overflow-y: auto;  /* Zeigt einen vertikalen Scrollbalken, wenn der Inhalt überläuft */
    word-wrap: break-word; /* Stellt sicher, dass lange Wörter umgebrochen werden */
}

.card-material {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-material {
    padding: 2px;
    background-color: #e3f2fd;
    border-radius: 5px;
}

.material-content:hover {
    color: #007bff;
    text-decoration: underline;
    transition: color 0.2s ease-in-out;
}

.material-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    position: relative;
}

.material-text {
    flex: 1;
    border: none;
    padding: 5px;
    background-color: transparent;
    width: 100%;
    word-break: break-all;
}

.material-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
}

.answer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.answer-text {
    flex: 1;
    border: none;
    padding: 5px;
    background-color: transparent;
    width: 100%;
}

.answer-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
}

.answer-icon.correct {
    color: #4CAF50;
}

.answer-icon.incorrect {
    color: #f44336;
}

.error {
    color: #f44336;
    font-size: 14px;
    text-align: center;
    padding: 10px;
}

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

.card-id {
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

.card-topic {
    color: #2196F3;
    font-weight: bold;
    flex-grow: 1;
}

.question-image {
    max-width: 800px;
    max-height: 200px;
    object-fit: contain;
    display: block;
    margin: 10px auto;
    border-radius: 5px;
}

.filter-container {
    margin-bottom: 20px;
    margin-top: 10px;
}

.topic-filter {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    width: 200px;
    cursor: pointer;
}

.topic-filter:hover {
    border-color: #2196F3;
}

.topic-filter:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.question-id {
    color: #666;
    padding: 5px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-block;
}

.answer-id {
    color: #666;
    padding: 5px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-block;
    margin-right: 10px;
}

.image-preview {
    margin-top: 10px;
    text-align: center;
    min-height: 100px;
    background-color: #f5f5f5;
    border-radius: 5px;
    padding: 10px;
    border: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview img {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    border-radius: 4px;
}

.pagination-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.pagination-controls button {
    padding: 5px 15px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
}

.pagination-controls button:hover {
    background-color: #0056b3;
}

.pagination-controls .page-indicator {
    margin: 0 10px;
    font-weight: bold;
}

.stroke-question {
    position: absolute; /* Absolut positionieren */
    top: 10px; /* 10px vom oberen Rand des memory-card Divs */
    right: 10px; /* 10px vom rechten Rand des memory-card Divs */
    background-color: rgba(64, 224, 208, 0.7); /* Hintergrundfarbe (z.B. ein Blau) */
    color: color: #004d40;
     padding: 5px 10px; /* Innenabstand */
    border-radius: 5px; /* Abgerundete Ecken */
    font-size: 0.9em; /* Etwas kleinere Schriftgröße */
    z-index: 10; /* Stellt sicher, dass es über anderen Inhalten liegt */
    white-space: nowrap; /* Verhindert Zeilenumbruch bei längeren Texten */
}

/* Popup-Overlay (Hintergrunddimmer) */
.popup-overlay {
    position: fixed; /* Fixiert auf dem Bildschirm */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparenter schwarzer Hintergrund */
    display: flex; /* Für Zentrierung des Inhalts */
    justify-content: center; /* Horizontale Zentrierung */
    align-items: center; /* Vertikale Zentrierung */
    z-index: 1000; /* Stellt sicher, dass das Popup über allem anderen liegt */
}

/* Popup-Inhalt (das Dialogfeld) */
.popup-content {
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%; /* Breite anpassen */
    max-width: 450px; /* Maximale Breite */
    text-align: center;
    box-sizing: border-box; /* Padding und Border werden in der Breite berücksichtigt */
}

.popup-content h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.comment-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    resize: vertical; /* Erlaubt vertikales Anpassen der Größe */
}

.popup-buttons {
    display: flex;
    justify-content: flex-end; /* Buttons rechtsbündig */
    gap: 10px; /* Abstand zwischen den Buttons */
}

.popup-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.popup-button.save {
    background-color: #007bff; /* Blau */
    color: white;
}

.popup-button.save:hover {
    background-color: #0056b3;
}

.popup-button.cancel {
    background-color: #6c757d; /* Grau */
    color: white;
}

.popup-button.cancel:hover {
    background-color: #5a6268;
}

.check-answers-button {
    margin-top: 20px; /* Space above the button */
    padding: 10px 20px;
    background-color: #4CAF50; /* Green background */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.check-answers-button:hover {
    background-color: #45a049;
}

/* --- Popup Container --- */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay */
    display: flex; /* Use flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    z-index: 1000; /* Ensure it's on top of other content */
    opacity: 0; /* Start hidden */
    visibility: hidden; /* Start hidden */
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Smooth transition */
}

.popup-container.show {
    opacity: 1;
    visibility: visible;
}

/* --- Popup Content Box --- */
.popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 350px;
    width: 90%; /* Responsive width */
    transform: scale(0.9); /* Start slightly smaller */
    transition: transform 0.3s ease; /* Smooth transition */
}

.popup-container.show .popup-content {
    transform: scale(1); /* Scale to normal size when shown */
}

/* --- Popup Icon --- */
.popup-icon {
    font-size: 80px; /* Large icon */
    margin-bottom: 15px;
}

.popup-icon.correct-icon {
    color: #4CAF50; /* Green for correct */
}

.popup-icon.incorrect-icon {
    color: #f44336; /* Red for incorrect */
}

/* --- Popup Message --- */
.popup-message {
    font-size: 1.2em;
    margin-bottom: 25px;
    color: #333;
}

/* --- Popup Close Button --- */
.popup-close-button {
    background-color: #007bff; /* Blue button */
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.popup-close-button:hover {
    background-color: #0056b3;
}

/* --- Styling for the answer icons (from previous example) --- */
.answer-icon.correct {
    color: green;
}

.answer-icon.incorrect {
    color: red;
}

.check-answers-button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.check-answers-button:hover {
    background-color: #45a049;
}

/* Role Management Styles */
.role-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.role-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.role-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.role-icon {
    font-size: 32px;
    margin-right: 15px;
}

.role-info {
    flex: 1;
}

.role-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.4em;
}

.role-description {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

.role-id {
    color: #999;
    font-size: 0.85em;
    font-weight: 600;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 12px;
}

.role-permissions-section {
    margin-bottom: 15px;
}

.role-permissions-section h4 {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 1em;
}

.role-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.permission-badge {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.permission-badge-small {
    background: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 400;
}

.permission-more {
    color: #6c757d;
    font-size: 0.8em;
    font-style: italic;
}

.no-permissions {
    color: #999;
    font-style: italic;
    font-size: 0.9em;
}

.role-groups-section {
    margin-bottom: 15px;
}

.role-groups-section h4 {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 1em;
}

.role-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.role-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s ease;
}

.btn-info:hover {
    background: #138496;
}

/* Permission Checkboxes */
.permissions-container {
    margin-top: 10px;
}

.permission-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.permission-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.permission-checkbox:hover {
    background-color: #f8f9fa;
}

.permission-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Role Groups Dialog */
.role-groups-dialog .dialog-content {
    max-width: 900px;
    width: 90%;
}

.roles-management-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.assigned-roles-section,
.available-roles-section {
    min-height: 400px;
}

.assigned-roles-section h4,
.available-roles-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.roles-list {
    max-height: 350px;
    overflow-y: auto;
}

.role-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fff;
    transition: background-color 0.2s ease;
}

.role-item:hover {
    background-color: #f8f9fa;
}

.role-item .role-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.role-item .role-avatar {
    font-size: 20px;
    margin-right: 12px;
}

.role-item .role-details {
    flex: 1;
}

.role-item .role-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.role-item .role-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 6px;
}

.role-permissions-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.roles-search {
    margin-bottom: 15px;
}

.roles-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.no-roles {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 30px;
    border: 2px dashed #ddd;
    border-radius: 8px;
}

/* Group Roles Dialog */
.group-roles-dialog .dialog-content {
    max-width: 900px;
    width: 90%;
}

.assigned-groups-section,
.available-groups-section {
    min-height: 400px;
}

.assigned-groups-section h4,
.available-groups-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.groups-list {
    max-height: 350px;
    overflow-y: auto;
}

.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fff;
    transition: background-color 0.2s ease;
}

.group-item:hover {
    background-color: #f8f9fa;
}

.group-item .group-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.group-item .group-avatar {
    font-size: 20px;
    margin-right: 12px;
}

.group-item .group-details {
    flex: 1;
}

.group-item .group-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.group-item .group-description {
    color: #666;
    font-size: 0.9em;
}

.groups-search {
    margin-bottom: 15px;
}

.groups-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .roles-management-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .role-list {
        grid-template-columns: 1fr;
    }
    
    .role-actions {
        flex-direction: column;
    }
    
    .permission-checkboxes {
        grid-template-columns: 1fr;
    }
}

/* OAuth Login Button Styles */
.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e9ecef;
}

.oauth-divider span {
    padding: 0 15px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.oauth-login-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    color: #495057;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    gap: 10px;
    margin-bottom: 15px;
}

.oauth-login-button:hover {
    border-color: #4285f4;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.2);
    text-decoration: none;
    color: #495057;
}

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

.oauth-login-button svg {
    flex-shrink: 0;
}

/* Google-specific styling */
.google-login:hover {
    border-color: #4285f4;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.2);
}

/* Apple-specific styling */
.apple-login {
    background: #000;
    color: white;
    border-color: #000;
}

.apple-login:hover {
    background: #333;
    border-color: #333;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.apple-login svg path {
    fill: white;
}
