/**
 * Task Manager Pro - Frontend CSS
 */

/* Grundlegende Styles */
.task-manager-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    line-height: 1.5;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.task-manager-container * {
    box-sizing: border-box;
}

/* Navigation */
.task-manager-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
    padding-bottom: 0;
    overflow-x: auto;
}

.task-manager-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.task-manager-nav li {
    margin-right: 5px;
}

.task-manager-nav a {
    display: block;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.task-manager-nav a:hover {
    color: #0274be;
    border-bottom-color: #0274be;
}

.task-manager-nav li.active a {
    color: #0274be;
    border-bottom-color: #0274be;
    font-weight: 600;
}

/* Hauptbereich */
.task-manager-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.task-manager-view {
    display: none;
}

.task-manager-view.active {
    display: block;
}

/* Sektions-Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.section-title {
    margin: 0;
    font-size: 20px;
    color: #333;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #0274be;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #0265a5;
    color: #fff;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Filter-Bereich */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.filter-group {
    display: flex;
    align-items: center;
}

.filter-group label {
    margin-right: 8px;
    font-weight: 500;
}

.filter-select, .filter-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

/* Aufgabenliste */
.task-list {
    margin-bottom: 30px;
}

.task-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.task-date {
    font-size: 13px;
    color: #666;
}

.task-description {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

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

.task-badges {
    display: flex;
    gap: 5px;
}

.task-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 3px;
    text-transform: uppercase;
}

.priority-high {
    background-color: #f44336;
    color: #fff;
}

.priority-medium {
    background-color: #ff9800;
    color: #fff;
}

.priority-low {
    background-color: #4caf50;
    color: #fff;
}

.status-pending {
    background-color: #9e9e9e;
    color: #fff;
}

.status-in-progress {
    background-color: #2196f3;
    color: #fff;
}

.status-completed {
    background-color: #4caf50;
    color: #fff;
}

.status-archived {
    background-color: #607d8b;
    color: #fff;
}

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

.task-btn {
    background: none;
    border: none;
    padding: 0;
    color: #0274be;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.task-btn:hover {
    color: #0265a5;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 15px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0274be;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .dashboard-sections {
        grid-template-columns: 2fr 1fr;
    }
}

/* Kalender */
.calendar-wrapper {
    margin-bottom: 30px;
}

.calendar-header-month {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-header-month h3 {
    margin: 0;
    font-size: 20px;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #333;
}

.fc-header-toolbar {
    margin-bottom: 15px !important;
}

.fc .fc-button-primary {
    background-color: #0274be !important;
    border-color: #0274be !important;
}

.fc .fc-button-primary:hover {
    background-color: #0265a5 !important;
    border-color: #0265a5 !important;
}

.fc .fc-daygrid-day.fc-day-today {
    background-color: rgba(2, 116, 190, 0.1) !important;
}

.fc-event {
    cursor: pointer;
}

.fc-event-title {
    font-weight: 500;
}

.priority-high-event {
    background-color: #f44336 !important;
    border-color: #d32f2f !important;
}

.priority-medium-event {
    background-color: #ff9800 !important;
    border-color: #f57c00 !important;
}

.priority-low-event {
    background-color: #4caf50 !important;
    border-color: #388e3c !important;
}

/* Archiv */
.archived-tasks-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.archived-task {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
}

/* PDF-Export */
.pdf-export-controls {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.pdf-preview {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 300px;
    font-family: monospace;
    white-space: pre-wrap;
}

/* Einstellungen */
.settings-form {
    max-width: 600px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}

.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.integrations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.integration-item {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
}

.integration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.integration-header h4 {
    margin: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0274be;
}

input:focus + .slider {
    box-shadow: 0 0 1px #0274be;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.integration-config {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-field .required {
    color: #f44336;
}

.form-field input[type="text"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.form-field textarea {
    min-height: 100px;
    resize: vertical;
}

/* Hilfsmeldungen */
.empty-message {
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 5px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.error {
    padding: 15px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    font-style: italic;
    color: #666;
}

.loading:after {
    content: "";
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top: 3px solid #0274be;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 767px) {
    .task-manager-container {
        padding: 15px 10px;
    }
    
    .task-manager-content {
        padding: 15px 10px;
    }
    
    .task-manager-nav {
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .task-manager-nav a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .filters {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 30px auto;
    }
}

/* Astra Theme spezifische Anpassungen */
.ast-container .task-manager-container {
    margin-bottom: 40px;
}

.ast-container .btn,
.ast-container input:checked + .slider {
    background-color: var(--e-global-color-primary, #0274be);
}

.ast-container .btn:hover {
    background-color: var(--e-global-color-primary-hover, #0265a5);
}

.ast-container .task-manager-nav a:hover,
.ast-container .task-manager-nav li.active a,
.ast-container .stat-value,
.ast-container .task-btn {
    color: var(--e-global-color-primary, #0274be);
}

.ast-container .task-manager-nav li.active a,
.ast-container .task-manager-nav a:hover {
    border-bottom-color: var(--e-global-color-primary, #0274be);
}