/* System-wide base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* System Header */
.system-header {
    background: #2c3e50;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 65px;
}

.nav-brand h3 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

/* Navigation menu styles */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.nav-link:active {
    transform: translateY(0);
}

/* Submenu styles - OPDATERET */
.nav-item-with-children {
    position: relative;
}

.nav-item-with-children > .nav-link::after {
    content: '▼';
    font-size: 0.7em;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.nav-item-with-children:hover > .nav-link::after {
    transform: rotate(180deg);
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #34495e;
    min-width: 240px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    margin-top: 5px;
}

.nav-item-with-children:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #34495e;
}

.submenu .nav-link {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
    font-size: 0.9rem;
    color: #ecf0f1;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
}

.submenu .nav-link:hover {
    background-color: rgba(255,255,255,0.12);
    color: white;
    padding-left: 30px;
    transform: translateX(2px);
}

.submenu .nav-link:last-child {
    border-bottom: none;
}

/* TØJ FØRSTE OG SIDSTE border-radius */
.submenu .nav-link:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.submenu .nav-link:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Active state for navigation */
.nav-link.active {
    background-color: rgba(255,255,255,0.15);
    color: white;
}

/* User menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.user-name {
    color: #ecf0f1;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-link {
    color: #e74c3c;
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid #e74c3c;
    border-radius: 5px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.logout-link:hover {
    background-color: #e74c3c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 150px);
}

/* System Footer */
.system-footer {
    background: #2c3e50;
    color: white;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #bdc3c7;
}

/* Error styles */
.error-container {
    text-align: center;
    padding: 80px 20px;
}

.error-container h1 {
    font-size: 5rem;
    color: #e74c3c;
    margin-bottom: 25px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.error-container p {
    font-size: 1.3rem;
    margin-bottom: 35px;
    color: #666;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        height: auto;
        padding: 20px;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        width: 100%;
        margin-left: 0;
        padding-left: 0;
        border: none;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin-top: 10px;
        margin-left: 20px;
        min-width: auto;
        width: calc(100% - 20px);
    }
    
    .submenu::before {
        display: none;
    }
    
    .nav-item-with-children > .nav-link::after {
        display: none;
    }
    
    .user-menu {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(255,255,255,0.2);
        border-left: none;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .error-container h1 {
        font-size: 3.5rem;
    }
}

/* Animation for better UX */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > * {
    animation: fadeInUp 0.6s ease-out;
}

/* Focus states for accessibility */
.nav-link:focus,
.logout-link:focus,
.btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .system-header,
    .system-footer {
        display: none;
    }
    
    .main-content {
        max-width: none;
        padding: 0;
    }
}
