﻿/* ================================================================
   SHARED.CSS - Konsolidierte gemeinsame Styles
   Einbinden in _Layout.cshtml VOR allen anderen CSS-Dateien:
   <link rel="stylesheet" href="~/css/shared.css" asp-append-version="true" />
   ================================================================ */


@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── Variablen ── */
:root {
    /* Layout & Surface */
    --bg: #f0f3fa;
    --surface: #ffffff;
    --surface-2: #f8faff;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    /* Primary & Accent */
    --primary: #0f172a;
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent: #0f172a;
    --accent-h: #1e293b;
    --accent-light: #f1f5f9;
    --accent-color: #4facfe;
    --secondary-color: #f093fb;
    /* Status */
    --success: #16a34a;
    --success-bg: #dcfce7;
    --success-color: #00d4aa;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --warning-color: #ffc107;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --danger-color: #ff6b6b;
    --info: #0284c7;
    --info-bg: #e0f2fe;
    --purple: #7c3aed;
    --purple-bg: #ede9fe;
    /* Text */
    --text: #0f172a;
    --text-muted: #64748b;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    /* Border */
    --border: #e2e8f0;
    --border-color: #e2e8f0;
    /* Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --border-radius: 12px;
    --border-radius-sm: 6px;
    /* Shadows */
    --shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    /* Font */
    --font: 'Plus Jakarta Sans', sans-serif;
    /* Circular Progress */
    --size: 160px;
    --thickness: 22px;
    --track: #ECECEC;
    --fill: #2C3E50;
}


/* ================================================================
   2. ANIMATION KEYFRAMES
   Quellen: dashboard.css, TimeTracking.css (dort löschen)
   ================================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}


/* ================================================================
   3. SCROLLBAR STYLES
   Quellen: dashboard.css, ProjectStructureTreeItem.css,
            Budgetplanning.css, index.css (dort löschen)
   ================================================================ */

/* Standard Scrollbar für .custom-scrollbar Klasse */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

    .custom-scrollbar::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* Schmale Scrollbar-Variante (6px) */
.slim-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.slim-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.slim-scrollbar::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

    .slim-scrollbar::-webkit-scrollbar-thumb:hover {
        background: #adb5bd;
    }


/* ================================================================
   4. EMPTY STATE
   Quellen: ProjectStructureTreeItem.css, gantt.css, index.css
   (dort löschen)
   ================================================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

    .empty-state i {
        font-size: 3rem;
        margin-bottom: 15px;
        opacity: 0.3;
    }

    .empty-state p {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }


/* ================================================================
   5. UTILITY KLASSEN
   Quelle: dashboard.css (dort löschen)
   ================================================================ */
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

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

.pulse {
    animation: pulse 2s infinite;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap {
    word-wrap: break-word;
    word-break: break-word;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-help {
    cursor: help;
}

.border-radius-lg {
    border-radius: 12px;
}

.border-radius-xl {
    border-radius: 16px;
}

.shadow-lg {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.shadow-xl {
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}


/* ================================================================
   6. CARET / TOGGLE ICON
   Quellen: gantt.css (doppelt definiert!), 
            ProjectStructureTreeItem.css
   (dort löschen)
   ================================================================ */
.caret {
    cursor: pointer;
    margin-right: 8px;
    color: #6c757d;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

    .caret.collapsed {
        transform: rotate(-90deg);
    }

    .caret:hover {
        color: #495057;
    }


/* ================================================================
   7. STATUS BADGES (Gemeinsam genutzt)
   Quellen: dashboard.css, index.css
   (dort löschen)
   ================================================================ */
.status-active,
.state-open {
    background: #cce5ff;
    color: #0066cc;
}

.status-completed,
.state-completed {
    background: #d4edda;
    color: #155724;
}

.status-onhold {
    background: #fce4ec;
    color: #c2185b;
}

.status-cancelled {
    background: #ffebee;
    color: #d32f2f;
}

.state-inprogress {
    background: #fff3cd;
    color: #856404;
}


/* ================================================================
   8. PRIORITY INDICATORS
   Quelle: dashboard.css (dort löschen)
   ================================================================ */
.priority-high {
    border-left: 4px solid #dc3545 !important;
}

.priority-medium {
    border-left: 4px solid #ffc107 !important;
}

.priority-low {
    border-left: 4px solid #28a745 !important;
}


/* ================================================================
   9. STATE COLOR CONTAINER
   Quelle: gantt.css (dort löschen)
   ================================================================ */
.statecolorcontainer {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}


/* ================================================================
   10. BUTTON ICON (.btn-icon)
   Quelle: ProjectStructureTreeItem.css (dort löschen)
   ================================================================ */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    transition: all 0.2s ease;
}

    .btn-icon:hover {
        background: #f8f9fa;
        color: #495057;
        border-color: #adb5bd;
    }


/* ================================================================
   11. BUTTON LINK FIX
   Quelle: gantt.css (dort löschen)
   ================================================================ */
.btn a {
    color: white;
    text-decoration: none;
}

.btn:hover a {
    color: white;
}


/* ================================================================
   12. SHARED MODAL STYLES
   Quelle: Budgetplanning.css (dort löschen)
   ================================================================ */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1.5rem 2rem;
}

    .modal-header h5 {
        margin: 0;
        font-weight: 600;
    }

.btn-close {
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    opacity: 1;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border: none;
    padding: 1.5rem 2rem;
    background: var(--light-bg);
}


/* ================================================================
   13. SHARED FORM CONTROLS
   Quelle: Budgetplanning.css (dort löschen)
   ================================================================ */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }


/* ================================================================
   TABLE
   ================================================================ */
.cm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

    .cm-table thead th {
        padding: 9px 14px;
        font-size: .7rem;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--text-muted);
        border-bottom: 1.5px solid var(--border);
        background: var(--surface-2);
        text-align: left;
    }

    .cm-table tbody td {
        padding: 11px 14px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .cm-table tbody tr:last-child td {
        border-bottom: none;
    }

    .cm-table tbody tr:hover {
        background: var(--surface-2);
    }

    .cm-table .td-link {
        color: var(--accent);
        font-weight: 600;
        text-decoration: none;
    }

        .cm-table .td-link:hover {
            text-decoration: underline;
        }

/* ================================================================
   14. ACCESSIBILITY
   Quelle: dashboard.css (dort löschen)
   ================================================================ */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .stat-card {
        border: 2px solid #000;
    }

    .task-item,
    .customer-item {
        border: 1px solid #000;
    }

    .action-btn {
        border: 2px solid;
    }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
.stat-card:focus-within,
.task-item:focus-within,
.customer-item:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.action-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}


/* ================================================================
   15. OVERFLOW PREVENTION
   Quelle: layout.css (dort löschen)
   ================================================================ */
html, body {
    overflow-x: hidden;
}

.main-content {
    overflow-x: hidden;
}

/* ================================================================
   CARD SYSTEM (Gemeinsam genutzt)
   Quellen: Details.cshtml, Scheduling.cshtml, Index.cshtml,
            BudgetPlanning.cshtml
   ================================================================ */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom:30px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .card-header h2 {
        margin: 0;
        font-size: 1.3rem;
        color: #333;
        font-weight: 600;
    }

    .card-header h5 {
        margin: 0;
        font-size: 1.1rem;
        color: #333;
        font-weight: 600;
    }

.card-actions {
    display: flex;
    gap: 10px;
}

.card-body {
    padding: 20px;
}


/* ================================================================
   PAGE HEADER (Gradient-Header)
   Quellen: Details.cshtml, Index.cshtml, Scheduling.cshtml,
            BudgetPlanning.cshtml
   ================================================================ */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

    .page-header h1 {
        margin: 0;
        font-size: 2rem;
        font-weight: 600;
    }

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.project-meta {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    opacity: 0.9;
    font-size: 0.9rem;
}

.creator-info,
.creation-date {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}


/* ================================================================
   STAT CARDS (Statistik-Karten)
   Quellen: Details.cshtml, Index.cshtml (beide hatten eigene
            leicht unterschiedliche Versionen)
   ================================================================ */
.statistics-section .stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

    .statistics-section .stat-card:hover {
        transform: translateY(-2px);
    }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-right: 15px;
}

/* Stat Icon Farben */
.stat-tasks .stat-icon,
.stat-active .stat-icon {
    background: #28a745;
}

.stat-progress .stat-icon,
.stat-archived .stat-icon {
    background: #17a2b8;
}

.stat-timeline .stat-icon,
.stat-planning .stat-icon {
    background: #ffc107;
}

.stat-deadline .stat-icon,
.stat-overdue .stat-icon {
    background: #dc3545;
}

.stat-content h3 {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.stat-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}


/* ================================================================
   NOTIFICATION ALERT
   Quelle: Details.cshtml
   ================================================================ */
.notification-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


/* ================================================================
   ACTION BUTTONS LAYOUT (nur das Grid, nicht die Farben)
   Die Farben kommen von .btn-primary / .btn-secondary
   ================================================================ */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}


/* ================================================================
   Klickbarer Aufgabenname (öffnet das Aufgaben-Popup)
   ================================================================ */
.task-open-link {
    cursor: pointer;
}

    .task-open-link:hover {
        text-decoration: underline;
    }