/* Task Manager specific content-body */
.content-body {
    overflow: hidden;
}

/* Content Wrapper */
.content-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Board Layout */
.layout-board {
    background: #ffffff;
    height: calc(100vh - 200px);
    padding: 0 0 48px 0;
}

.board-columns {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    height: 100%;
}

.board-columns::-webkit-scrollbar {
    height: 6px;
}

.board-columns::-webkit-scrollbar-track {
    background: var(--border-light);
    border-radius: 3px;
}

.board-columns::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.board-columns::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Board Column */
.board-column {
    background: #f3f3f370;
    border-radius: var(--border-radius-lg);
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-speed) ease;
    height: 100%;
}

.board-column:hover {
    box-shadow: var(--shadow-md);
}

/* Column Header */
.column-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-secondary);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.column-title i {
    font-size: 16px;
    color: var(--text-secondary);
}

.column-count {
    background: var(--background-primary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
}

/* Column Content */
.column-content {
    padding: 4px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.column-content::-webkit-scrollbar {
    width: 4px;
}

.column-content::-webkit-scrollbar-track {
    background: transparent;
}

.column-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.column-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Task Card */
.task-card {
    background: var(--background-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-sm);
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.task-card:active {
    cursor: grabbing;
}

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

.task-card-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0; /* Remove margin as it's handled by the header now */
    padding-right: 10px; /* Add padding to prevent text from overlapping with the button */
}

.task-card-actions .btn-icon {
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.task-card-actions .btn-icon:hover,
.task-card-actions .btn-icon:focus {
    color: var(--text-primary);
    background-color: var(--background-hover);
}

.task-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.task-card-meta .badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--border-radius);
    color: #0055CC !important;
    font-weight: bold;
    padding: 5px;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.task-card-timestamp {
    font-size: 11px;
    color: var(--text-muted);
}

.task-card-user {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-card-user .username {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.task-card-user .avatar, .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    border: 2px solid var(--background-primary);
    box-shadow: var(--shadow-sm);
}

/* Column-specific styling */
#unassigned-column .column-header {
    border-top: 3px solid var(--text-muted);
}

#assigned-column .column-header {
    border-top: 3px solid var(--primary-color);
}

#in-progress-column .column-header {
    border-top: 3px solid #ff991f;
}

#completed-column .column-header {
    border-top: 3px solid #36b37e;
}

/* SortableJS Styles */
.sortable-ghost {
    opacity: 0.4;
    background: var(--background-hover);
    border: 2px dashed var(--primary-color);
    transform: rotate(2deg);
}

.sortable-chosen {
    cursor: grabbing;
    transform: rotate(1deg);
    box-shadow: var(--shadow-lg);
}

.sortable-drag {
    opacity: 0.8;
    transform: rotate(3deg);
    box-shadow: var(--shadow-lg);
}

/* Board Header */
.board-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.board-header h1 {
    font-weight: 600;
    color: #2c3e50;
}

/* Board Tabs */
.board-tabs {
    margin-top: 1rem;
}

.board-tabs .nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

.board-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 12px 20px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    transition: all var(--transition-speed) ease;
}

.board-tabs .nav-link:hover {
    color: var(--text-primary);
    background: var(--background-hover);
    border-color: transparent;
}

.board-tabs .nav-link.active {
    color: var(--primary-color);
    background: var(--background-primary);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.board-tabs .nav-link i {
    font-size: 14px;
}

/* Tab Content */
.tab-content {
    padding-top: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tab-pane.active {
    flex: 1;
}

/* Summary Container */
.summary-container {
    padding: 1rem 0;
}

.summary-card {
    background: var(--background-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
    height: 100%;
}

.summary-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 24px;
}

.summary-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.summary-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading Spinner - Replaced with skeleton loading */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Skeleton Loading Styles */
.skeleton-card {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: default !important;
    opacity: 0.8;
    pointer-events: none;
}

.skeleton-card:hover {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
}

.skeleton-title {
    width: 90%;
    height: 1.2em;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 12px;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-badge {
    width: 60px;
    height: 20px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    margin-right: 8px;
    display: inline-block;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-badge.small {
    width: 40px;
    height: 18px;
}

.skeleton-timestamp {
    width: 80px;
    height: 14px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 8px;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.skeleton-avatar {
    width: 24px;
    height: 24px;
    background: linear-gradient(90deg, #d0d0d0 25%, #e0e0e0 50%, #d0d0d0 75%);
    background-size: 200% 100%;
    border-radius: 50%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-username {
    width: 60px;
    height: 14px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Authentication Message */
.auth-message-container {
    max-width: 400px;
    margin: auto;
    padding: 32px;
    background: var(--background-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

/* Task Detail Modal */
.modal-content {
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Custom Modal Size and Position */
#taskDetailModal .modal-dialog {
    max-width: 1280px !important;
    width: 1280px;
    height: calc(70vw);
    margin: 70px auto;
}

#taskDetailModal .modal-content {
    height: 960px;
    display: flex;
    flex-direction: column;
}

#taskDetailModal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

#taskDetailModal .modal-header {
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
}

#taskDetailModal .modal-footer {
    border-top: 1px solid #eee;
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.modal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.modal-value {
    font-size: 1rem;
    color: #212529;
}

.modal-badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.modal-progress {
    height: 8px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.modal-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6c757d;
}

.modal-topic {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-icon {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
    color: #6c757d;
}

.modal-metric {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal-metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.modal-metric-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

/* Detail Cards */
.detail-card {
    background: var(--background-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.detail-card h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.metric-item {
    background: var(--background-secondary);
    padding: 12px;
    border-radius: var(--border-radius);
    text-align: center;
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.details-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.details-list li:last-child {
    border-bottom: none;
}

.details-list li strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.details-list li span {
    color: var(--text-primary);
    text-align: right;
}

.report-note-link-container a {
    display: inline-block;
    padding: 8px 12px;
    background: var(--background-secondary);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all var(--transition-speed) ease;
    word-break: break-all;
}

.report-note-link-container a:hover {
    background: var(--background-hover);
    color: var(--primary-hover);
}

.panel-badge {
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 11px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .board-columns {
        gap: 8px;
    }
    
    .board-column {
        width: 260px;
        min-width: 260px;
    }
    
    .column-content {
        min-height: 300px;
    }
    
    .task-detail-panel {
        width: 100%;
        max-width: 100vw;
    }
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 8px;
}

.breadcrumb-item {
    font-size: 13px;
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--text-muted);
    margin: 0 8px;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 1320px) {
    #taskDetailModal .modal-dialog {
        width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        margin: 70px 20px;
    }
}

@media (max-width: 768px) {
    #taskDetailModal .modal-dialog {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        margin: 70px 10px;
        height: calc(100vh - 140px);
    }
    
    #taskDetailModal .modal-content {
        height: calc(100vh - 140px);
    }
}

.task-card-difficulty .badge {
    color: white !important;
}

/* Main Content Containers */
#mainContentTaskManager {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#authRequiredMessageTaskManager {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create-task-button {
    padding: 10px;
    margin-top: 5px;
    border-radius: 6px;
    cursor: pointer;
    color: #6c757d; /* A muted text color */
    font-weight: 500;
    text-align: left;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.create-task-button:hover {
    background-color: #f0f2f5; /* Light grey background on hover */
    color: #212529; /* Darker text on hover */
}

.create-task-button .fas {
    margin-right: 8px;
}

/* Submenu Styling */
.dropdown-menu .dropdown-submenu {
    position: relative;
}

.dropdown-menu .dropdown-submenu .dropdown-menu {
    top: -8px; /* Align with the parent menu item */
    left: 100%;
    margin-left: .1rem;
    margin-right: .1rem;
    display: none;
    position: absolute;
}

.dropdown-menu .dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropdown-submenu > a:after {
    display: block;
    content: " ";
    float: right;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 5px 0 5px 5px;
    border-left-color: #ccc;
    margin-top: 5px;
    margin-right: -10px;
}

/* Add specific styles for the standalone page to mimic modal layout */
.task-detail-page-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px); /* Adjust based on your header's height */
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: .3rem;
}
.task-detail-page-container .btn-close {
    display: none; /* Hide close button on standalone page */
}
.task-detail-page-container .modal-body {
    flex-grow: 1; /* Make body fill available vertical space */
    padding: 0;
    overflow-y: hidden; /* Delegate scrolling to the child */
}
.task-detail-page-container .task-modal-container {
    height: 100%; /* Ensure the inner container fills the modal-body */
}