/* ============================================
   TOOLS DASHBOARD - ZENTRALE STYLES
   Diese Datei wird von allen Seiten eingebunden
   ============================================ */

/* Material Symbols Font - Fallback falls Google Fonts nicht lädt */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

/* Fallback Font-Face Definition */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v301/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOem.ttf) format('truetype');
    font-display: swap;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CSS Variables */
:root {
    --main-grey: #f5f7fa;
    --medium-grey: #c3cfe2;
    --dark-grey: #2c3e50;
    --darker-grey: #34495e;
    --p4d-blue: #3498db;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    
    /* Layout */
    --sidebar-width: 250px;
    --content-padding: 30px;
    --content-max-width: 1400px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--main-grey) 0%, var(--medium-grey) 100%);
    min-height: 100vh;
    display: flex;
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--dark-grey) 0%, var(--darker-grey) 100%);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    padding: 20px 0;
    padding-bottom: 0;
    overflow: hidden;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 10px 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}

.sidebar-logo img {
    max-width: 180px;
    height: auto;
}

.nav-title {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 15px 20px 10px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 12px 20px;
    transition: var(--transition);
    font-size: 14px;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar nav a.active {
    background: var(--p4d-blue);
    color: #fff;
}

.sidebar nav a .material-symbols-outlined {
    font-size: 20px;
}

.sidebar nav a.logout-link {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: var(--content-padding);
    padding-top: 30px !important; /* Einheitlicher oberer Abstand */
    flex: 1;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* ========== CONTAINER ========== */
.container,
.app-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    margin-top: 0 !important; /* Kein zusätzlicher oberer Abstand */
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 40px;
    margin-bottom: 30px;
}

/* ========== HEADER BLOCK ========== */
/* Einheitliches Header-Design für alle Seiten */
.main-content > header,
.container .header-block,
.container > header {
    background: white;
    padding: 30px;
    border-left: 5px solid rgb(0, 90, 140);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    text-align: center;
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

.main-content > header h1,
.container .header-block h1,
.container > header h1,
.container > h1:first-child {
    font-size: 2.5em;
    color: rgb(0, 90, 140);
    margin-bottom: 10px;
}

.main-content > header h1 .material-symbols-outlined,
.container .header-block h1 .material-symbols-outlined,
.container > header h1 .material-symbols-outlined {
    font-size: 1em;
    vertical-align: middle;
    margin-right: 10px;
}

.main-content > header p,
.container > header p {
    color: #666;
    font-size: 1.1em;
}

.subtitle {
    color: var(--text-light);
    font-size: 14px;
}

/* ========== INFO BOX ========== */
.info-box {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid var(--p4d-blue);
}

.info-box h2 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.info-box ul {
    margin-left: 20px;
    color: var(--text-light);
}

/* ========== HAMBURGER BUTTON ========== */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--dark-grey);
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    transition: var(--transition);
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.open {
    display: block;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 70px;
        width: 100%;
    }
    
    .container {
        padding: 20px;
    }
}

/* ========== MATERIAL ICONS ========== */
.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ========== DASHBOARD SPECIFICS ========== */
.welcome-hero {
    padding-left: 15px;
    border-left: 5px solid var(--p4d-blue);
}

.welcome-hero h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.welcome-hero p {
    color: var(--text-light);
}

.section h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.welcome-text {
    font-size: 1.1em;
    color: var(--text-light);
    margin-bottom: 30px;
}

.welcome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.welcome-card {
    display: block;
    background: #f8f9fa;
    padding: 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.welcome-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--p4d-blue);
}

.welcome-card h3 {
    color: var(--p4d-blue);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.welcome-card p {
    color: var(--text-light);
    font-size: 0.95em;
    margin: 0;
}

.card-icon {
    font-size: 2em;
    margin-bottom: 10px;
    display: block;
    color: var(--p4d-blue);
}

.footer-link {
    color: var(--p4d-blue);
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

/* ========== QUICKLINKS SIDEBAR ========== */
.quicklinks-section {
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
    padding-bottom: 10px;
    max-height: 45vh;
    overflow-y: auto;
}

.quicklinks-section .nav-title {
    padding: 12px 20px 6px;
    font-size: 10px;
}

.quicklinks-section .nav-title.collapsible {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
    transition: var(--transition);
}

.quicklinks-section .nav-title.collapsible:hover {
    color: rgba(255,255,255,0.8);
}

.quicklinks-section .nav-title .collapse-icon {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.quicklinks-section .nav-title.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.quicklinks-nav.collapsible-content {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 1;
}

.quicklinks-nav.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.quicklinks-nav {
    display: flex;
    flex-direction: column;
}

.quicklinks-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 8px 20px;
    font-size: 12px;
    transition: var(--transition);
}

.quicklinks-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.quicklinks-nav a .material-symbols-outlined {
    font-size: 16px;
}

.quicklinks-nav.logout-nav {
    margin-top: 10px;
    padding-top: 10px;
}

.quicklinks-nav .logout-link {
    color: rgba(255,255,255,0.6);
}

.quicklinks-nav .logout-link:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* ========== AI ASSISTENTEN TABS ========== */
.ai-section {
    margin-top: 40px;
}

.ai-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-section h2 .material-symbols-outlined {
    color: var(--p4d-blue);
}

.ai-tabs {
    display: flex;
    gap: 10px;
}

.ai-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    background: #f8f9fa;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
}

.ai-tab:hover {
    border-color: var(--p4d-blue);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.ai-tab .material-symbols-outlined {
    font-size: 20px;
}

.ai-tab-external {
    font-size: 16px !important;
    margin-left: auto;
    opacity: 0.6;
}

/* ========== QUICKLINK OVERLAY ========== */
.quicklink-overlay {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 900;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.quicklink-overlay.active {
    transform: translateX(0);
}

.quicklink-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--dark-grey);
    color: #fff;
}

.quicklink-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.quicklink-close {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--border-radius);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.quicklink-close:hover {
    background: rgba(255,255,255,0.2);
}

.quicklink-close .material-symbols-outlined {
    font-size: 18px;
}

.quicklink-iframe {
    flex: 1;
    width: 100%;
    border: none;
}

/* Responsive QuickLinks */
@media (max-width: 768px) {
    .quicklink-overlay {
        left: 0;
    }
    
    .quicklinks-section {
        max-height: none;
    }
    
}

/* ========== ACCESSIBILITY ========== */
/* Screen reader only - visuell versteckt, aber für Screenreader zugänglich */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
