/* DSGVO Tool - Vollständiges Styling */
:root {
    --primary-color: #1a5b8e;
    --primary-light: #e8f4fd;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --grey-color: #95a5a6;
    --white: #ffffff;
    --sidebar-width: 300px;
    --header-height: 80px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Reset und Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Sidebar Toggle verstecken */
.sidebar-toggle {
    display: none;
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-color) 0%, #16537e 100%);
    color: var(--white);
    transform: translateX(0);
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sidebar-header .subtitle {
    font-size: 0.875rem;
    opacity: 0.8;
    display: block;
    margin-bottom: 0.25rem;
}

.sidebar-header small {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Navigation */
.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav li {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 2rem;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-right: 3px solid var(--accent-color);
}

.nav-link i {
    width: 20px;
    margin-right: 1rem;
    text-align: center;
}

/* PDF Outline */
.pdf-outline {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-outline h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.outline-list {
    max-height: 200px;
    overflow-y: auto;
}

.outline-item {
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: var(--transition);
    border-left: 3px solid transparent;
    padding-left: 0.5rem;
}

.outline-item:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
}

/* Kapitel Navigation */
.chapter-navigation {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-grow: 1;
}

.chapter-navigation h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chapter-navigation ul {
    list-style: none;
}

.chapter-navigation li {
    margin: 0.5rem 0;
}

.chapter-navigation a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    display: block;
    transition: var(--transition);
}

.chapter-navigation a:hover {
    color: var(--white);
    padding-left: 0.5rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
    background-color: var(--white);
    display: flex;
    flex-direction: column;
}

/* Content Header */
.content-header {
    background-color: var(--white);
    padding: 1rem 2rem;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.pdf-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.control-btn:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.control-btn:disabled {
    background-color: var(--grey-color);
    cursor: not-allowed;
    transform: none;
}

.page-info {
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 1rem;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#zoom-level {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-container input {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
    width: 250px;
}

.search-container input:focus {
    border-color: var(--primary-color);
}

.search-container button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-nav-btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.8rem;
}

/* Views */
.view {
    display: none;
    padding: 2rem;
    flex: 1;
    animation: fadeIn 0.3s ease-in;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-description {
    color: var(--grey-color);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* PDF Viewer */
.pdf-container {
    position: relative;
    background-color: #525659;
    border-radius: var(--border-radius);
    overflow: auto;
    max-height: calc(100vh - var(--header-height) - 4rem);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
}

#pdf-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: var(--shadow-lg);
    background-color: var(--white);
    border-radius: 4px;
}

.text-layer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2;
    line-height: 1.0;
}

.text-layer span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

/* PDF Loading */
.pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--grey-color);
}

.pdf-loading.hidden {
    display: none;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--grey-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Kapitelübersicht */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.chapter-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    border-top: 4px solid var(--primary-color);
    transition: var(--transition);
    cursor: pointer;
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.chapter-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.chapter-card p {
    color: var(--grey-color);
    margin-bottom: 1rem;
}

.chapter-card .slide-count {
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

/* DSGVO Essentials */
.essentials-filter {
    margin-bottom: 2rem;
}

.essentials-filter label {
    font-weight: 600;
    margin-right: 1rem;
}

.essentials-filter select {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: var(--white);
    cursor: pointer;
    min-width: 200px;
}

.essentials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.essential-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border-left: 4px solid var(--success-color);
    transition: var(--transition);
}

.essential-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.essential-card h4 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.essential-card .article-ref {
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-block;
}

/* Suchansicht */
.advanced-search-form {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.search-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-options input[type="text"] {
    padding: 1rem;
    border: 2px solid #e1e8ed;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.search-settings {
    display: flex;
    gap: 2rem;
}

.search-settings label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    align-self: flex-start;
}

.primary-btn:hover {
    background-color: var(--secondary-color);
}

.search-results {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #e1e8ed;
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background-color: var(--primary-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.search-result-item .result-page {
    font-size: 0.875rem;
    color: var(--grey-color);
    margin-bottom: 0.5rem;
}

.search-result-item .result-excerpt {
    color: var(--dark-color);
}

.search-highlight {
    background-color: yellow;
    font-weight: bold;
}

/* Links Ansicht */
.links-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.link-category {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.link-category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.link-category ul {
    list-style: none;
}

.link-category li {
    margin-bottom: 1rem;
}

.link-category a {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-category a:hover {
    color: var(--primary-color);
}

.link-category a::before {
    content: '\f35d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background-color: var(--secondary-color);
}

/* App Loading Screen */
.app-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.app-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h2 {
    margin-bottom: 2rem;
}

#loading-status {
    margin-top: 1rem;
    opacity: 0.8;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--dark-color);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: var(--transition);
    z-index: 2000;
    max-width: 400px;
}

.notification-toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#toast-close {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar-toggle:checked ~ .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .content-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        height: auto;
    }

    .pdf-controls {
        justify-content: center;
    }

    .search-container {
        width: 100%;
    }

    .search-container input {
        flex: 1;
        width: auto;
    }

    .view {
        padding: 1rem;
    }

    .pdf-container {
        padding: 1rem;
        max-height: calc(100vh - 160px);
    }

    .chapters-grid,
    .essentials-grid,
    .links-categories {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .search-settings {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}
