/**
 * Skeleton Loader Styles
 * Used for Turbo Frame lazy loading placeholders
 */

/* Skeleton container */
.skeleton-container {
    opacity: 0.7;
}

/* Skeleton table structure */
.skeleton-table {
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.skeleton-row {
    display: table-row;
}

.skeleton-row.skeleton-header {
    background: #f5f5f5;
}

.skeleton-cell {
    display: table-cell;
    padding: 12px 8px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.skeleton-header .skeleton-cell {
    height: 40px;
    background: linear-gradient(90deg, #e0e0e0 0%, #eeeeee 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

/* Skeleton pulse animation */
.skeleton-pulse {
    height: 16px;
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Different heights for variety */
.skeleton-row:nth-child(odd) .skeleton-pulse {
    height: 14px;
}

/* Shimmer animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Skeleton for cards/boxes */
.skeleton-box {
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-box-sm {
    height: 20px;
    margin-bottom: 8px;
}

.skeleton-box-md {
    height: 40px;
    margin-bottom: 12px;
}

.skeleton-box-lg {
    height: 60px;
    margin-bottom: 16px;
}

/* Skeleton for text lines */
.skeleton-text {
    height: 12px;
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 2px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-text.medium {
    width: 70%;
}

.skeleton-text.full {
    width: 100%;
}

/* Turbo frame loading state */
turbo-frame[busy] {
    opacity: 0.6;
    pointer-events: none;
}

turbo-frame[busy]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #3c8dbc;
    border-top-color: transparent;
    border-radius: 50%;
    animation: turbo-spinner 0.8s linear infinite;
}

@keyframes turbo-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transition when content loads */
turbo-frame > * {
    animation: turbo-fade-in 0.3s ease-out;
}

@keyframes turbo-fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inline Status Change Dropdown */
.inline-status-dropdown {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    min-width: 140px;
    padding: 4px 0;
    animation: turbo-fade-in 0.15s ease-out;
}

.inline-status-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    transition: background 0.15s;
}

.inline-status-option:hover {
    background: #f5f5f5;
    text-decoration: none;
    color: #333;
}

.inline-status-option.selected {
    background: #e8f4fc;
    font-weight: 600;
}

.inline-status-option .color-box {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    margin-right: 8px;
    flex-shrink: 0;
}

.inline-status-option .status-name {
    font-size: 13px;
}

/* Make status rectangle clickable */
#managetask-grid .rectangle {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

#managetask-grid .rectangle:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ============================================================================
   DAYBREAK SECTION LOADER - CU-868gvqu82
   Per-section loading indicators (replaces full-page spinner)
   ============================================================================ */

/* Loading state for any section */
.daybreak-loading {
    position: relative !important;
    pointer-events: none;
    overflow: hidden; /* Contain the overlay within bounds */
}

/* Semi-transparent overlay */
.daybreak-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100px;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50; /* Lower z-index to avoid overlapping modals/dropdowns */
    border-radius: inherit;
    box-sizing: border-box;
}

/* Spinner animation */
.daybreak-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #3c8dbc;
    border-radius: 50%;
    animation: daybreak-spin 0.8s linear infinite;
}

/* Smaller spinner variant */
.daybreak-spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* Loading text below spinner */
.daybreak-loader-text {
    margin-top: 12px;
    font-size: 13px;
    color: #666;
}

@keyframes daybreak-spin {
    to {
        transform: rotate(360deg);
    }
}

/* DataTables specific - show processing indicator inline */
.dataTables_wrapper .dataTables_processing {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 10px auto !important;
    width: auto !important;
    height: auto !important;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 13px;
    color: #666;
    z-index: 10;
}

/* Box/Card loading state */
.box.daybreak-loading > .box-body,
.card.daybreak-loading > .card-body,
.panel.daybreak-loading > .panel-body {
    opacity: 0.5;
    transition: opacity 0.2s;
}

/* Button loading state */
.btn.daybreak-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.daybreak-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: daybreak-spin 0.8s linear infinite;
}

.btn.daybreak-loading::after {
    border-color: rgba(255,255,255,0.3);
    border-top-color: #fff;
}

.btn-default.daybreak-loading::after,
.btn-light.daybreak-loading::after {
    border-color: rgba(0,0,0,0.2);
    border-top-color: #333;
}

/* Inline loader for small elements */
.daybreak-inline-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.daybreak-inline-loader .daybreak-spinner {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* Skeleton placeholder while loading */
.daybreak-skeleton {
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}
