@import "fontstyles.css";

:root {
    --shadow-default: 1px 1px 4px -2px rgba(0,0,0,0.3), 0 0 12px 0 rgba(0,0,0,0.06);
    --shadow-alternative: 0 0 16px -2px rgba(47,72,85,0.4);
    --border-radius: 0.5rem;
    --border-radius-less: 0.375rem;
    
    /* Colors */
    --color-neutral0: #f8f9fa;
    --color-neutral00: #f1f3f5;
    --color-neutral1: #dee2e6;
    --color-neutral2: #ced4da;
    
    --color-dark0: #495057;
    --color-dark1: #343a40;
    --color-dark2: #212529;
    
    --color-text: #212529;
    --color-text-light: #868e96;
    
    --color-error: #dc3545;
    --color-error-light: #dc35451a;
    --color-error-dark: #842029;
    
    --color-success: #198754;
    --color-success-light: #19875420;
    --color-success-dark: #0f5132;
}

button:disabled {
    opacity: 1;
    color: lightgrey !important;
    border-color: lightgrey !important;
    box-shadow: unset !important;
}
/*
** OVERLAYS
*/
#slide-panel.visible {
    transform: translateX(0);
}

#fullscreen-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#slide-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.status-column.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
    border: 2px dashed #3b82f6;
}

.drag-placeholder {
    background-color: rgba(209, 213, 219, 0.2);
    border: 2px dashed #d1d5db;
    margin: 0.5rem 0;
    height: 3rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

/* Footer Styles */
footer {
    background-color: var(--color-neutral0);
    text-align: center;
    box-shadow: var(--shadow-default);
    margin-top: auto;
    display: flex;
    flex-direction: column;
    padding: 1rem 2rem;
    border-top: 1px solid var(--color-neutral1);
    min-height: 4rem;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

footer .copyright {
    color: var(--color-text);
    font-size: 0.875rem;
    flex: 1;
    text-align: center;
}

footer .language-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

footer select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    border: 1px solid var(--color-neutral1);
    border-radius: var(--border-radius-less);
    background-color: white;
    font-size: 0.875rem;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23536A76' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

footer select:hover {
    border-color: var(--color-dark1);
}

footer select:focus {
    outline: none;
    border-color: var(--color-dark1);
    box-shadow: 0 0 0 2px rgba(83, 106, 118, 0.1);
}

.footer-debug {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-neutral1);
    font-size: 0.75rem;
    color: var(--color-text-light);
    opacity: 0.8;
    width: 100%;
}

.footer-debug small {
    display: inline-block;
    margin: 0 0.5rem;
}

.footer-debug small:not(:last-child)::after {
    content: "•";
    margin-left: 0.5rem;
    opacity: 0.5;
}

/* Main Container Styles */
section.main {
    flex: 1;
    padding: 0 2rem 1.25rem 2rem;
    /* max-width: 1200px;
    margin: 0 auto;
    width: 100%; */
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 8rem);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Login Page Styles */
#login-form {
    max-width: 600px;
    margin: auto;
    padding: 2.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-default);
    width: 100%;
}

#login-form h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 1rem;
}

#login-form p {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

#login-form form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

#login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#login-form .form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

#login-form input[type="email"] {
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--color-neutral2);
    border-radius: var(--border-radius-less);
    font-size: 0.875rem;
    width: 100%;
    transition: all 0.2s;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
}

#login-form input[type="email"]:hover {
    border-color: var(--color-dark0);
}

#login-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-dark1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 0 2px rgba(52, 58, 64, 0.15);
}

#login-form button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--color-text);
    border: 1px solid var(--color-neutral2);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius-less);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#login-form button[type="submit"]:hover {
    border-color: var(--color-dark1);
    color: var(--color-dark1);
    background: var(--color-neutral00);
}

#login-form button[type="submit"]:focus {
    outline: none;
    border-color: var(--color-dark1);
    box-shadow: 0 0 0 3px rgba(52, 58, 64, 0.2);
}

.error-container,
.success-container {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-less);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.error-container {
    background-color: var(--color-error-light);
    border: 1px solid var(--color-error);
    color: var(--color-error-dark);
}

.success-container {
    background-color: var(--color-success-light);
    border: 1px solid var(--color-success);
    color: var(--color-success-dark);
}

/* Task Detail View */
.task-detail {
    padding: 2rem 0;
    margin: 0 auto;
    width: 100%;
}

.task-header {
    display: flex;
    align-items: center;
    max-width: calc(100% - 3rem); /* Platz lassen für "more"-Button rechts */
    padding-right: 0.5rem; /* optional etwas Abstand zum Fold-Button */
}

.task-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.task-menu-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}
/* .tasks-list .sub-task-content {
    overflow: hidden;
} */
.tasks-list .description {
    overflow: hidden;
    white-space: pre;
    text-overflow: ellipsis;
}
.sub-task-content h4 {
    text-overflow: ellipsis;
    white-space: pre;
    overflow: hidden;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    border-radius: var(--border-radius-less);
    transition: all 0.2s;
}

.back-button:hover {
    background-color: var(--color-neutral00);
    text-decoration: none;
}

.back-button .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Drag and Drop Styles */
.task-status-column {
    transition: background-color 0.2s ease;
}

.task-status-column.sortable-ghost {
    background-color: rgba(229, 231, 235, 0.5);
}

.task-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.task-card.sortable-ghost {
    opacity: 0.5;
    background-color: #f3f4f6;
}

.task-card.sortable-drag {
    cursor: grabbing;
    transform: rotate(2deg) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body.dragging .task-status-column {
    min-height: 150px;
    border: 2px dashed #e5e7eb;
}

body.dragging .task-status-column:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}


/*
** TRACKING
*/
.tracking-icon.material-symbols-outlined {
    font-size: 1rem;
    line-height: 1rem;
    width: 1rem;
    height: 1rem;
}
.time_tracker .tracker.material-symbols-outlined,
.time_tracker .tracker .material-symbols-outlined {
    font-size: 16px;
}
.time_tracker 
.tracker svg {
    fill: green;
    width: 23px;
    height: auto;
}
.tracking svg {
    fill: red;
}
.tracking .total_time_spent {
    display: none;
}
.time_tracker .tracking_time,
.time_tracker .tracked_time {
    font-size: 12px;
}
.time_tracker .tracker.tracking ~ .tracking_time {
    display: inline-block;
}

.time_entry {
    display: flex;
    gap: 14px;
}

.time_tracker {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Notifications system styles */
#notifications-container {
    z-index: 1000;
    max-width: 350px;
}

.notification {
    max-width: 100%;
    opacity: 1;
    transition: all 0.3s ease;
}

.notification.slide-in {
    animation: slide-in 0.3s ease forwards;
}

.notification.fade-out {
    opacity: 0;
    transform: translateX(30px);
}

@keyframes slide-in {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Table Sorting Styles */
th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
    padding-right: 2rem !important;
}

th.sortable:hover {
    background-color: var(--color-neutral00);
}

th.sortable::after {
    font-family: 'Material Symbols Outlined';
    content: "swap_vert";
    position: absolute;
    right: 8px;
    opacity: 0.4;
    font-size: 1.1rem;
    line-height: 1;
}

th.sortable.sort-asc::after {
    content: "arrow_upward";
    opacity: 1;
}

th.sortable.sort-desc::after {
    content: "arrow_downward";
    opacity: 1;
}

/* Subtask Styling in Time Entry List */
.subtask-entry {
    /* Optional: Slightly different background for subtask rows */
    /* background-color: #f9fafb; */ 
}

.subtask-entry td.is-subtask {
    padding-left: 1.5rem !important; /* Indent subtask title */
    position: relative;
}

.subtask-entry td.is-subtask::before {
    content: "\e156"; /* Material Symbols subdirectory_arrow_right */
    font-family: 'Material Symbols Outlined';
    font-size: 0.9rem;
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
}

/* Status Column Delete Button Hover Visibility */
.status-column-header .delete-status-button {
    visibility: hidden; /* Hide by default */
    opacity: 0;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.status-column-header:hover .delete-status-button.can-delete {
    visibility: visible; /* Show on hover if deletable */
    opacity: 1;
}

/* We need a way for JS to mark deletable buttons */
.delete-status-button.can-delete {
     /* Styles to apply when JS determines it can be deleted (empty and not last) */
}
.delete-status-button:not(.can-delete) {
     display: none !important; /* Ensure non-deletable buttons are truly gone */
}

/* Optional: Slightly adjust position if needed */
.status-column-header .delete-status-button {
    /* Adjust positioning if it overlaps weirdly */
    /* Example: position: relative; top: -2px; */
}

/* Utility: Boxed container for main content */
.boxed-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Small neutral New Task button for status columns */
.add-task-btn {
    border: 1px solid #d1d5db; /* gray-300 */
    color: #4b5563; /* gray-600 */
    background: transparent;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    box-shadow: none;
    transition: background 0.15s, color 0.15s, border 0.15s;
    display: none;
}
.add-task-btn:hover, .add-task-btn:focus {
    background: #f3f4f6; /* gray-100 */
    color: #111827; /* gray-900 */
    border-color: #9ca3af; /* gray-400 */
}

.group:hover .add-task-btn {
    display: flex;
}
/* Only hide empty message on hover when there's a new-task-btn sibling (editors only) */
.group:hover .empty-state-group .empty-message {
    display: none;
}

/* Project and Task View Headers - Minimal styling for better distinction */
.project-meta h1,
.task-meta h1,
.task-detail h1 {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-neutral1);
    margin-bottom: 1.5rem;
}

.project-meta h1:first-child,
.task-meta h1:first-child,
.task-detail h1:first-child {
    margin-top: 0;
}

.project-meta .flex.justify-between.items-center.mb-6,
.task-meta .flex.justify-between.items-center.mb-6,
.task-detail .flex.justify-between.items-center.mb-6 {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-neutral1);
    margin-bottom: 1.5rem;
}

.project-meta .flex.justify-between.items-center.mb-6 h1,
.task-meta .flex.justify-between.items-center.mb-6 h1,
.task-detail .flex.justify-between.items-center.mb-6 h1 {
    margin: 0;
    padding: 0;
    border: none;
}