/* Custom CSS für das kommunale IT-Sicherheitsprüfungssystem */

/* Hauptfarben basierend auf den Anforderungen */
:root {
    --primary-color: #004054;
    --primary-light: #005a73;
    --primary-dark: #002a36;
    --text-white: #ffffff;
    --text-dark: #333333;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    /* Bootstrap overrides */
    --bs-primary: #004054;
    --bs-primary-rgb: 0, 64, 84;
    --bs-link-color: #004054;
    --bs-link-hover-color: #005a73;
    --bs-pagination-active-bg: #004054;
    --bs-pagination-active-border-color: #004054;
    --bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(0, 64, 84, 0.25);
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(0, 64, 84, 0.25);
    --bs-accordion-active-bg: rgba(0, 64, 84, 0.08);
    --bs-accordion-active-color: #004054;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(0, 64, 84, 0.2);
}

/* Body und allgemeine Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Navigation Styles */
.navbar-custom {
    background-color: var(--primary-color) !important;
    border-bottom: 2px solid var(--primary-dark);
    flex-shrink: 0;
    z-index: 1030;
}

.navbar-custom .navbar-brand,
.navbar-custom .nav-link {
    color: var(--text-white) !important;
    transition: color 0.3s ease;
}

.navbar-custom .nav-link:hover {
    color: #e0e0e0 !important;
}

.navbar-custom .dropdown-menu {
    background-color: var(--primary-light);
    border: 1px solid var(--primary-dark);
}

.navbar-custom .dropdown-item {
    color: var(--text-white);
}

.navbar-custom .dropdown-item:hover {
    background-color: var(--primary-dark);
    color: var(--text-white);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    background-color: var(--bg-light);
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.dashboard-stat {
    text-align: center;
    padding: 2rem;
}

.dashboard-stat .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

.dashboard-stat .stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Enforce Bootstrap utility classes to brand blue */
.bg-primary,
.text-bg-primary { 
    background-color: var(--primary-color) !important; 
    color: var(--text-white) !important;
}
.text-primary { color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }
.badge.bg-primary { background-color: var(--primary-color) !important; }

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 64, 84, 0.25);
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.login-header {
    background-color: var(--primary-color);
    color: var(--text-white);
    padding: 2rem;
    text-align: center;
}

.login-body {
    padding: 2rem;
}

/* Glossar Highlighting */
.glossary-term {
    background-color: rgba(255, 255, 0, 0.2);
    cursor: help;
    border-bottom: 1px dotted var(--primary-color);
    transition: background-color 0.2s ease;
}

.glossary-term:hover {
    background-color: rgba(255, 255, 0, 0.4);
}

/* Aktiver Glossar-Hilfe-Modus */
.glossary-help-active .glossary-term {
    background-color: rgba(255, 255, 0, 0.3) !important;
    cursor: help !important;
    border-bottom: 1px dotted #004054 !important;
    padding: 1px 2px !important;
    border-radius: 2px !important;
    transition: all 0.2s ease !important;
    color: #333 !important;
    text-decoration: none !important;
    position: relative !important;
}

.glossary-help-active .glossary-term:hover {
    background-color: #ffeb3b !important;
    background: linear-gradient(120deg, #ffeb3b 0%, #ffc107 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    border-bottom-color: #002a36 !important;
}

/* Pulsing-Animation für Glossar-Begriffe */
.glossary-help-active .glossary-term {
    animation: glossaryPulse 3s ease-in-out infinite;
}

@keyframes glossaryPulse {
    0%, 100% { 
        background-color: #ffff00;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    50% { 
        background-color: #fff700;
        box-shadow: 0 2px 6px rgba(255, 255, 0, 0.3);
    }
}

/* Hover-Tooltip für Glossar-Begriffe */
.glossary-tooltip {
    position: fixed !important;
    background: #333 !important;
    color: white !important;
    padding: 12px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    z-index: 10000 !important;
    max-width: 300px !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    pointer-events: none !important;
}

.glossary-tooltip .tooltip-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.glossary-tooltip .tooltip-category {
    background: var(--primary-color) !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: normal !important;
}

.glossary-tooltip .tooltip-content {
    font-size: 13px !important;
    line-height: 1.3 !important;
}

/* Pfeil für Tooltip */
.glossary-tooltip::after {
    content: '' !important;
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border: 6px solid transparent !important;
    border-top-color: #333 !important;
}

/* Pfeil nach oben wenn Tooltip unten ist */
.glossary-tooltip.tooltip-below::after {
    top: -12px !important;
    border-top-color: transparent !important;
    border-bottom-color: #333 !important;
}

/* Hilfe-Button im Header hervorheben wenn aktiv */
.glossary-help-active #helpDropdown,
#helpDropdown.glossary-help-active-button {
    background-color: rgba(255, 255, 0, 0.4) !important;
    border-radius: 4px !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3) !important;
}

#helpDropdown.glossary-help-active-button:hover {
    background-color: rgba(255, 255, 0, 0.6) !important;
    transform: scale(1.05) !important;
}

/* Glossar Modal */
.glossary-modal .modal-header {
    background-color: var(--primary-color);
    color: var(--text-white);
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    background-color: var(--primary-color);
}

/* Tables */
.table th {
    background-color: var(--primary-color);
    color: var(--text-white);
    border: none;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 64, 84, 0.05);
}

/* Alerts */
.alert-primary {
    background-color: rgba(0, 64, 84, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* Tabs */
.nav-tabs .nav-link { color: var(--primary-color); }
.nav-tabs .nav-link:hover { color: var(--primary-dark); }
.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-color: var(--primary-color) var(--primary-color) #fff;
}

/* Accordion */
.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: rgba(0, 64, 84, 0.08);
}

/* Footer */
footer.navbar-custom {
    flex-shrink: 0;
    border-top: 2px solid var(--primary-dark);
    z-index: 1030;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-stat {
        padding: 1rem;
    }
    
    .dashboard-stat .stat-number {
        font-size: 2rem;
    }
    
    .login-card {
        margin: 1rem;
    }
    
    .login-header,
    .login-body {
        padding: 1.5rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .main-content::-webkit-scrollbar {
        width: 4px;
    }
}

/* Smooth scrolling for main content */
.main-content {
    scroll-behavior: smooth;
}

/* Ensure cards and content don't get cut off */
.card {
    margin-bottom: 1rem;
}

/* Fix for modals and dropdowns with fixed layout */
.modal {
    z-index: 1050;
}

.dropdown-menu {
    z-index: 1040;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border-custom {
    color: var(--primary-color);
}

/* 2FA Styles */
.two-factor-container {
    text-align: center;
}

.qr-code-container {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    display: inline-block;
    margin: 1rem 0;
}

.verification-code-input {
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5rem;
    font-family: 'Courier New', monospace;
}

/* Utility Classes */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.border-primary-custom {
    border-color: var(--primary-color) !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}