/* ======================== */
/* VARIABLEN: DARK THEME   */
/* ======================== */
:root {
    --dark-bg: #121212;
    --dark-card: #1e1e1e;
    --dark-element: #252525;
    --dark-border: rgba(255, 255, 255, 0.05);
    --text-primary: #e0e0e0;
    --text-secondary: #aaa;
    --accent-primary: #6e8efb;
    --accent-secondary: #a777e3;
    --accent-glow: rgba(110, 142, 251, 0.4);
    --header-gradient: linear-gradient(135deg, #1a1c3b, #2e1a47);
}

/* ======================== */
/* BASIC STYLES & TYPO     */
/* ======================== */
body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: #fff;
    margin-top: 0;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px var(--accent-glow);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* ======================== */
/* LAYOUT & CONTAINERS     */
/* ======================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.content-area {
    padding: 2rem 0;
}

.card {
    background: var(--dark-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid var(--dark-border);
}

.card-header {
    border-bottom: 1px solid var(--dark-border);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.card-title {
    margin: 0;
    color: #ddd;
    font-size: 1.3rem;
    font-weight: 600;
}

/* ======================== */
/* BUTTONS                 */
/* ======================== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--dark-element);
    color: var(--text-primary);
    border: 1px solid var(--dark-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-secondary:hover {
    background: rgba(110, 142, 251, 0.1);
}

/* ======================== */
/* TABLES                  */
/* ======================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

th {
    text-align: left;
    padding: 0.8rem;
    background: var(--dark-element);
    color: #ddd;
    font-weight: 600;
    border-bottom: 2px solid rgba(110, 142, 251, 0.3);
}

td {
    padding: 0.8rem;
    border-top: 1px solid #333;
    color: #ccc;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* ======================== */
/* FORMULAR-ELEMENTE       */
/* ======================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ddd;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    color: #eee;
    background-color: var(--dark-element);
    border: 1px solid #444;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--accent-primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(110, 142, 251, 0.25);
}

/* ======================== */
/* ALERT BOXEN             */
/* ======================== */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #7defa1;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.2);
    color: #5dccff;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* ======================== */
/* NAVIGATION              */
/* ======================== */
.site-header {
    background: var(--header-gradient);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
}

/* Basic navbar styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    flex-wrap: nowrap;
}

.navbar-dark {
    background-color: #1a1a1a;
}

.navbar-brand {
    display: flex;
    align-items: center;
    color: white;
    font-weight: 700;
    margin-right: 1rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    transition: all 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #ffffff;
    background-color: rgba(255,255,255,0.1);
}

.navbar-dark .navbar-nav .active > .nav-link {
    color: #ffffff;
    background: linear-gradient(to right, #6441a4, #2a2a2a);
}

/* Dropdown styling */
.dropdown-menu {
    background-color: #252525;
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-top: 0;
    top: 100%;
    left: 0;
}

/* Fix inconsistent indentation in nav items */
.navbar-nav .nav-item {
    margin: 0;
    padding: 0;
}

/* Dropdown item styling */
.dropdown-item {
    color: rgba(255,255,255,0.8);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

/* Navbar Toggle Button */
.navbar-toggler {
    border: none;
    background: transparent;
    padding: 0.5rem;
    color: rgba(255,255,255,0.8);
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: auto;
    float: right;
    height: 38px;
    align-self: center;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(110, 142, 251, 0.4);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5em;
    height: 1.5em;
}

/* Overlay backdrop */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1029;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-backdrop.show {
    display: block;
    opacity: 1;
}

body.menu-open {
    overflow: hidden;
}

/* SINGLE mobile navigation section */
@media (max-width: 991px) {
    /* OFF-CANVAS MENU - RIGHT SIDE */
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -280px;
        bottom: 0;
        width: 280px;
        height: 100vh !important;
        padding: 1rem;
        background-color: #1a1a1a;
        z-index: 1030;
        overflow-y: auto;
        transition: transform 0.3s ease;
    }
    
    /* Transform from RIGHT side when open */
    .navbar-collapse.show {
        transform: translateX(-280px);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    }
    
    /* Mobile menu item styles */
    .navbar-nav .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Mobile dropdown styling */
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: auto;
        background-color: rgba(0, 0, 0, 0.2);
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin-left: 1rem;
        padding: 0;
    }
    
    .navbar-nav .nav-link,
    .navbar-nav .dropdown-item {
        padding: 0.75rem 1rem !important; /* Force consistent padding */
    }
    
    /* Dropdown toggle arrow */
    .navbar-nav .dropdown-toggle::after {
        float: right;
        margin-top: 0.5rem;
    }

    .navbar-brand {
        padding-left: 0;
        margin-right: auto;
    }

    .navbar-toggler {
        margin-right: 0;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 42px;
    }

    .dropdown-menu {
        padding-left: 0 !important; /* Override any padding from dropdown.css */
    }
}

/* BRAND & MENU */
.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.nav-brand:hover {
    text-decoration: none;
    color: white;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-item {
    margin: 0 15px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* ======================== */
/* FOOTER                  */
/* ======================== */
.site-footer {
    background: var(--dark-card);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--dark-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-item {
    margin-left: 1.5rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--accent-primary);
}

/* ======================== */
/* BADGES & UTILITY        */
/* ======================== */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
    background-color: var(--dark-element);
    color: var(--text-secondary);
}

.badge-primary {
    background-color: var(--accent-primary);
    color: white;
}

.badge-secondary {
    background-color: var(--accent-secondary);
    color: white;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Backdrop overlay for mobile menu */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1029;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-backdrop.show {
    display: block;
    opacity: 1;
}

/* Prevent body scrolling when menu is open */
body.menu-open {
    overflow: hidden;
}

/* ======================== */
/* RESPONSIVE & MOBILE NAV */
/* ======================== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }

    .nav-item {
        margin-left: 0;
        margin-bottom: 0.5rem;
        width: 100%;
    }

    .nav-link {
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        margin-top: 1rem;
        justify-content: center;
    }

    .footer-item {
        margin: 0 0.75rem;
    }
}

/* Fixed Mobile Navigation Styles */

/* Basic navbar structure */
.navbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0.5rem 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

/* Ensure toggler is on the same line as brand */
.navbar-toggler {
    padding: 0.25rem 0.5rem;
    margin-left: auto;
    float: right;
    height: 38px;
    align-self: center;
}

/* Dropdown alignment fix */
.dropdown-menu {
    margin-top: 0;
    top: 100%;
    left: 0;
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    background-color: #252525;
}

/* Fix inconsistent indentation in nav items */
.navbar-nav .nav-item {
    margin: 0;
    padding: 0;
}

@media (max-width: 991px) {
    /* Mobile drawer styles */
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh !important;
        padding: 1rem 0;
        background-color: #1a1a1a;
        z-index: 1030;
        overflow-y: auto;
        transition: transform 0.3s ease;
    }
    
    .navbar-collapse.show {
        transform: translateX(-280px);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    }
    
    /* Clean dropdown positioning on mobile */
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin: 0;
        padding: 0 0 0 1rem;
        background-color: rgba(0, 0, 0, 0.2);
    }
    
    /* Backdrop for mobile menu */
    .mobile-menu-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1029;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .mobile-menu-backdrop.show {
        display: block;
        opacity: 1;
    }
    
    /* Mobile menu item spacing */
    .navbar-nav .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* Ensure all nav items have consistent styling */
    .navbar-nav .nav-link {
        padding-left: 1rem !important;
    }
    
    .navbar-nav .dropdown-item {
        padding: 0.75rem 1rem;
    }
}
