/* Ultra-Premium Design System */
:root {
    /* Colors - Premium Dark Theme */
    --bg-primary: #0a0e14;
    --bg-secondary: #0d1117;
    --bg-tertiary: #161b22;
    --bg-elevated: #1c2128;
    --bg-overlay: #22272e;
    
    --border-primary: #30363d;
    --border-secondary: #21262d;
    --border-hover: #484f58;
    
    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-tertiary: #8b949e;
    --text-muted: #6e7681;
    
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-yellow: #d29922;
    --accent-red: #f85149;
    --accent-purple: #bc8cff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #3fb950 0%, #238636 100%);
    --gradient-info: linear-gradient(135deg, #58a6ff 0%, #1f6feb 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px rgba(88, 166, 255, 0.3);
    
    /* Animation */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Allgemeine Stile */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: radial-gradient(circle at 50% 0%, rgba(88, 166, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    color: var(--accent-blue);
    filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.4));
}

.brand-text {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-info);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-badge {
    padding: 4px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.nav-link.active {
    color: var(--accent-blue);
    background: var(--bg-elevated);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Logout Button - Premium Design from Dashboard */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 8px;
    color: #f85149;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(248, 81, 73, 0.2);
    border-color: #f85149;
    transform: translateY(-1px);
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

/* Wrapper auf volle Breite */
.wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px;
    position: relative;
    z-index: 1;
}

/* Passwort-Container */
.password-container {
    background: #161b22;
    border: 1px solid #30363d;
    padding: 48px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    margin: 120px auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.password-container h2 {
    margin: 0 0 32px 0;
    font-size: 1.5rem;
    text-align: center;
    color: #f0f6fc;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.password-container input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: #0d1117;
    color: #c9d1d9;
    transition: all 0.2s ease;
    font-family: inherit;
}

.password-container input:focus {
    border-color: #1f6feb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.password-container button {
    width: 100%;
    background: #238636;
    color: #ffffff;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.15s ease;
    font-family: inherit;
}

.password-container button:hover {
    background: #2ea043;
}

.password-container button:active {
    background: #2c974b;
    transform: scale(0.98);
}

/* Haupteditor Container */
.container {
    background: #0d1117;
    padding: 0;
    max-width: 100%;
    margin: 0 auto;
    display: none;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
    padding: 16px 0 0 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.25rem;
    margin: 48px 0 16px 0;
    color: #f0f6fc;
    font-weight: 600;
    letter-spacing: -0.3px;
    border-bottom: 1px solid #21262d;
    padding-bottom: 12px;
}

/* Legacy fixed buttons - Removed in favor of navbar buttons */

/* Formular-Stil */
.form-container {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.form-container:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.form-container label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #f0f6fc;
}

.form-container label:first-of-type {
    margin-top: 0;
}

.form-container textarea,
.form-container select,
.form-container input {
    width: 100%;
    padding: 8px 12px;
    background: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.15s ease;
}

.form-container textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.form-container textarea:focus,
.form-container select:focus,
.form-container input:focus {
    border-color: #1f6feb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

/* Checkbox Styling */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.checkbox-label:hover {
    border-color: #1f6feb;
    background: #0d1117;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    margin-top: 3px;
    cursor: pointer;
    accent-color: #238636;
}

.checkbox-label span {
    flex: 1;
}

.checkbox-hint {
    display: block;
    margin-top: 4px;
}

.form-container button {
    margin-top: 24px;
    width: 100%;
    background: #238636;
    color: #ffffff;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s ease;
    font-family: inherit;
}

.form-container button:hover {
    background: #2ea043;
}

.form-container button:active {
    background: #2c974b;
    transform: scale(0.98);
}

/* Tabellen-Stil */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #21262d;
}

table th {
    background: var(--bg-elevated);
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    color: #c9d1d9;
    font-size: 0.875rem;
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr {
    transition: background-color 0.15s ease;
}

table tbody tr:hover {
    background: #161b22;
}

.no-data {
    text-align: center;
    margin-top: 24px;
    padding: 48px 24px;
    font-size: 0.875rem;
    color: #8b949e;
    background: #161b22;
    border-radius: 6px;
    border: 1px solid #30363d;
}

/* Frak-Editor Link */
.frak-editor-link {
    display: inline-block;
    margin: 16px 0 24px 0;
    padding: 8px 16px;
    background: #21262d;
    color: #58a6ff;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #30363d;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.frak-editor-link:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.frak-editor-link:active {
    transform: scale(0.97);
}

/* Action Buttons */
.actions-cell {
    white-space: nowrap;
}

.toggle-btn,
.edit-btn,
.delete-btn {
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s ease;
    font-family: inherit;
    margin-right: 6px;
    display: inline-block;
    min-width: auto;
    white-space: nowrap;
}

/* Toggle Button */
.toggle-btn {
    background: transparent;
    color: #58a6ff;
    border: 1px solid #58a6ff;
}

.toggle-btn:hover {
    background: #1f6feb;
    border-color: #1f6feb;
    color: #ffffff;
}

.toggle-btn:active {
    transform: scale(0.95);
}

/* Edit Button */
.edit-btn {
    background: transparent;
    color: #d29922;
    border: 1px solid #d29922;
}

.edit-btn:hover {
    background: #bb8009;
    border-color: #bb8009;
    color: #ffffff;
}

.edit-btn:active {
    transform: scale(0.95);
}

/* Lösch-Button */
.delete-btn {
    background: transparent;
    color: #f85149;
    border: 1px solid #f85149;
    margin-right: 0;
}

.delete-btn:hover {
    background: #da3633;
    border-color: #da3633;
    color: #ffffff;
}

.delete-btn:active {
    transform: scale(0.95);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(35, 134, 54, 0.2);
    color: #3fb950;
    border: 1px solid #3fb950;
}

.status-badge.inactive {
    background: rgba(158, 106, 3, 0.2);
    color: #d29922;
    border: 1px solid #d29922;
}

/* Inactive Row Styling */
.inactive-row {
    opacity: 0.6;
}

.inactive-row:hover {
    opacity: 0.8;
}

/* Notification System */
.notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    transition: top 0.3s ease;
    max-width: 500px;
    text-align: center;
    border: 1px solid;
}

.notification.show {
    top: 24px;
}

.notification-success {
    background: #161b22;
    color: #3fb950;
    border-color: #238636;
}

.notification-error {
    background: #161b22;
    color: #f85149;
    border-color: #da3633;
}

.notification-warning {
    background: #161b22;
    color: #d29922;
    border-color: #9e6a03;
}

.notification-info {
    background: #161b22;
    color: #58a6ff;
    border-color: #1f6feb;
}

/* Loading Spinner */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 17, 23, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

.loader.show {
    display: flex;
}

.spinner {
    border: 3px solid #21262d;
    border-top: 3px solid #58a6ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 16px;
    color: #c9d1d9;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Disabled State für Dropdowns */
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #0d1117;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-description {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #8b949e;
    font-weight: 400;
}

/* Section Styling */
.form-section, .messages-section {
    margin-bottom: 48px;
}

.section-header {
    margin-bottom: 16px;
}

.section-description {
    margin-top: 4px;
    font-size: 0.8125rem;
    color: #8b949e;
    font-weight: 400;
}

/* Login Enhancements */
.login-header {
    margin-bottom: 24px;
}

.login-subtitle {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #8b949e;
    text-align: center;
    font-weight: 400;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.label-hint {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: #8b949e;
    font-weight: 400;
}

/* Character Counter */
.char-counter {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #8b949e;
    text-align: right;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    background: #238636;
    color: #ffffff;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #2ea043;
}

.btn-primary:active {
    background: #2c974b;
    transform: scale(0.98);
}

/* Table Container */
.table-container {
    position: relative;
}

/* Actions Column */
.actions-column {
    width: 100px;
    text-align: center;
}

/* Enhanced No Data Message */
.no-data svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-data p {
    margin: 0 0 4px 0;
    font-size: 0.875rem;
    color: #c9d1d9;
    font-weight: 500;
}

.no-data span {
    font-size: 0.8125rem;
    color: #8b949e;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 6px;
    border: 3px solid #0d1117;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Responsive Verbesserungen */
@media (max-width: 768px) {
    .wrapper {
        padding: 16px;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .btn-logout {
        padding: 6px 10px;
        font-size: 0.8125rem;
        gap: 6px;
    }
    
    .btn-logout svg {
        width: 16px;
        height: 16px;
    }
    
    .btn-icon {
        width: 32px;
        height: 32px;
    }
    
    .nav-links {
        gap: 4px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
    
    .brand-badge {
        display: none;
    }
    
    .frak-editor-link {
        margin: 12px 0 16px 0;
        font-size: 0.8125rem;
        padding: 6px 12px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.125rem;
    }
    
    .page-description, .section-description {
        font-size: 0.8125rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
    }
    
    table th, table td {
        padding: 8px;
        white-space: nowrap;
    }
    
    .form-container {
        padding: 16px;
    }
    
    .password-container {
        padding: 32px 24px;
        margin: 80px auto;
    }
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 4, 9, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #30363d;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #f0f6fc;
}

.modal-close {
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: #30363d;
    color: #c9d1d9;
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-hint {
    margin: 16px 0 0 0;
    padding: 12px;
    background: rgba(187, 128, 9, 0.1);
    border: 1px solid #bb8009;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: #d29922;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #30363d;
}

.btn-secondary {
    background: transparent;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
}
