/* 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(188, 140, 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-purple);
    filter: drop-shadow(0 0 8px rgba(188, 140, 255, 0.4));
}

.brand-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #bc8cff 0%, #8b5cf6 100%);
    -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-purple);
    background: var(--bg-elevated);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent-purple);
    box-shadow: 0 0 8px var(--accent-purple);
}

.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 {
    width: 100%;
    max-width: 1600px;
    padding: 32px;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

/* Titel */
h1 {
    margin-bottom: 24px;
    font-size: 2.25rem;
    font-weight: 700;
    text-align: left;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    border-bottom: 1px solid var(--border-secondary);
    padding-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Labels */
label {
    display: block;
    margin-top: 20px;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #f0f6fc;
    text-align: left;
}

label:first-of-type {
    margin-top: 0;
}

/* Formularelemente */
select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
    display: block;
    cursor: pointer;
}

select:hover {
    border-color: var(--border-hover);
}

select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(188, 140, 255, 0.15);
}

/* Button */
button {
    width: 100%;
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--gradient-success);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    font-family: inherit;
    box-shadow: var(--shadow-sm);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

button:active {
    transform: scale(0.98);
}

/* Editor-Link */
.editor-link {
    display: inline-block;
    align-self: flex-start;
    margin: 0 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;
}

.editor-link:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.editor-link:active {
    transform: scale(0.97);
}

/* Table Container */
.table-container {
    overflow-x: auto;
    margin-top: 32px;
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
}

/* Tabelle */
table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: transparent;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-secondary);
    white-space: nowrap;
}

th {
    background: var(--bg-elevated);
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background-color var(--transition-fast);
}

tbody tr:hover {
    background: var(--bg-elevated);
}

/* Layout */
.container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
}

/* Notification System */
.notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 500px;
    text-align: center;
    border: 1px solid;
    backdrop-filter: blur(8px);
}

.notification.show {
    top: 24px;
}

.notification-success {
    background: rgba(22, 27, 34, 0.95);
    color: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(63, 185, 80, 0.3);
}

.notification-error {
    background: rgba(22, 27, 34, 0.95);
    color: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(248, 81, 73, 0.3);
}

.notification-warning {
    background: rgba(22, 27, 34, 0.95);
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
    box-shadow: 0 0 20px rgba(210, 153, 34, 0.3);
}

.notification-info {
    background: rgba(22, 27, 34, 0.95);
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(188, 140, 255, 0.3);
}

/* 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 var(--border-secondary);
    border-top: 3px solid var(--accent-purple);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 16px rgba(188, 140, 255, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 20px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Disabled State */
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, .configs-section {
    margin-bottom: 48px;
}

.section-header {
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 1.125rem;
    margin: 0 0 4px 0;
    color: #f0f6fc;
    font-weight: 600;
}

.section-description {
    margin-top: 4px;
    font-size: 0.8125rem;
    color: #8b949e;
    font-weight: 400;
}

/* Form Group */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.label-hint {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: #8b949e;
    font-weight: 400;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    margin-top: 24px;
    padding: 10px 16px;
    background: #238636;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    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;
}

/* Enhanced No Data Message */
.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 24px;
    padding: 48px 24px;
    font-size: 0.875rem;
    color: #8b949e;
    background: #161b22;
    border-radius: 6px;
    border: 1px solid #30363d;
}

.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 Design */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .wrapper {
        padding: 24px 16px;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .btn-logout {
        padding: 6px 10px;
        font-size: 0.8125rem;
        gap: 6px;
    }
    
    .btn-logout svg {
        width: 16px;
        height: 16px;
    }
    
    .nav-links {
        gap: 4px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
    
    .brand-badge {
        display: none;
    }
    
    .editor-link {
        margin-bottom: 16px;
        font-size: 0.8125rem;
        padding: 6px 12px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }
    
    .page-description, .section-description {
        font-size: 0.8125rem;
    }
    
    .section-header h2 {
        font-size: 1rem;
    }
    
    table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
    }
    
    th, td {
        padding: 8px;
        white-space: nowrap;
    }
    
    .form-container {
        padding: 20px 16px;
    }
}

/* Action Buttons */
.toggle-btn,
.edit-btn,
.delete-btn {
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    font-family: inherit;
    margin-right: 6px;
    display: inline-block;
    min-width: auto;
    white-space: nowrap;
}

/* Icon-only buttons */
.icon-btn {
    padding: 6px 8px;
    font-size: 16px;
    min-width: 34px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Toggle Button */
.toggle-btn {
    background: transparent;
    color: var(--accent-purple);
    border: 1px solid var(--accent-purple);
}

.toggle-btn:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.toggle-btn:active {
    transform: scale(0.95);
}

/* Edit Button */
.edit-btn {
    background: transparent;
    color: var(--accent-yellow);
    border: 1px solid var(--accent-yellow);
}

.edit-btn:hover {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.edit-btn:active {
    transform: scale(0.95);
}

/* Delete Button */
.delete-btn {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    margin-right: 0;
}

.delete-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.delete-btn:active {
    transform: scale(0.95);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.active {
    background: rgba(35, 134, 54, 0.15);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
    box-shadow: 0 0 8px rgba(63, 185, 80, 0.2);
}

.status-badge.inactive {
    background: rgba(158, 106, 3, 0.15);
    color: var(--accent-yellow);
    border: 1px solid var(--accent-yellow);
    box-shadow: 0 0 8px rgba(210, 153, 34, 0.2);
}

/* Inactive Row Styling */
.inactive-row {
    opacity: 0.6;
}

.inactive-row:hover {
    opacity: 0.8;
}

/* Actions Column */
.actions-column {
    width: 280px;
    min-width: 280px;
    text-align: center;
}

.actions-cell {
    white-space: nowrap;
    text-align: center;
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 4, 9, 0.85);
    backdrop-filter: blur(8px);
    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: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-elevated);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, #bc8cff 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-overlay);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.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: 14px;
    background: rgba(188, 140, 255, 0.08);
    border: 1px solid rgba(188, 140, 255, 0.3);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--accent-purple);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-elevated);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--bg-overlay);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.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%;
    }
    
    .actions-cell button {
        margin-bottom: 4px;
        display: block;
        width: 100%;
    }
}