/* public/mobile/report-detail-view.css */

#reportDetailView .view-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0.5rem;
    background-color: transparent;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 1001; /* Above mobile header (1000) but below modals */
    pointer-events: auto; /* Ensure clicks are captured */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

#reportDetailView .view-header h2 {
    display: none; /* Hide the header completely */
}

#reportDetailView .view-header .back-button {
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.1em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

#reportDetailView .view-header .back-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

#reportDetailView .view-header .back-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

#reportDetailContent {
    padding: 0 1rem 1rem;
    background-color: var(--bg-primary);
    margin-top: -5px; /* Move content up to reduce space */
}

.detail-section {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px var(--shadow-color);
}

/* Special padding for collaborators section */
.detail-section:has(.colaborador-item) {
    padding: 1rem 0;
}

.detail-section:has(.colaborador-item) h4 {
    padding: 0 1rem;
}

.detail-section:has(.colaborador-item) .details-list {
    margin: 0;
}

.colaborador-item {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.detail-section h4 {
    font-size: 1.1em;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.detail-section h4 .badge {
    font-size: 0.9em;
    padding: 0.3em 0.6em;
    margin-left: 0.5em;
}

.detail-section p {
    margin-bottom: 0.5rem;
    font-size: 0.95em;
    line-height: 1.5;
}

.detail-section p strong {
    color: var(--text-primary);
}

.details-list {
    list-style: none;
    padding-left: 0;
    font-size: 0.95em;
}

.details-list li {
    padding: 0.3rem 0;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Allow small text to wrap */
}

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

.details-list li i {
    margin-right: 0.6em;
    color: var(--secondary-color);
    width: 20px; /* Ensure icons align */
    text-align: center;
}
.details-list li small {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-left: 0.5em;
    display: block; /* Make it take full width if needed */
    width: 100%;
    padding-left: calc(20px + 0.6em); /* Align with text after icon */
    margin-top: 0.2em;
}

/* Collaborator item styles */
.colaborador-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.colaborador-item:last-child {
    border-bottom: none;
}

.colaborador-item:nth-child(odd) {
    background-color: var(--bg-tertiary);
}

.colaborador-item:nth-child(even) {
    background-color: var(--bg-secondary);
}

.colaborador-info {
    display: flex;
    align-items: center;
    margin-bottom: 0.4rem;
    justify-content: flex-start;
}

.colaborador-info i {
    margin-right: 0.5em;
    color: var(--primary-color);
    font-size: 1.1em;
    flex-shrink: 0;
}

.colaborador-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.98em;
    line-height: 1.2;
    flex: 1;
}

.jornada-details {
    padding-left: 0;
    font-size: 0.85em;
    margin-top: 0.3rem;
}

.jornada-time {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.83em;
    box-shadow: 0 1px 3px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.jornada-time i {
    margin: 0 0.25em;
    font-size: 0.9em;
}

.jornada-time i.fa-clock {
    color: #1976d2;
}

.jornada-time i.fa-coffee {
    color: #d32f2f;
}

/* Additional styles for better differentiation */
.details-list {
    padding: 0 !important;
}

.colaborador-item:first-child {
    padding-top: 0.5rem !important;
}

/* Table styles for parts section */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.table-sm td, .table-sm th {
    padding: 0.3rem;
}

.table thead th {
    background-color: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-align: left;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

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

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

.badge-danger {
    color: #fff;
    background-color: #dc3545;
}

.badge-warning {
    color: #212529;
    background-color: #ffc107;
}

.badge-info {
    color: #fff;
    background-color: #17a2b8;
}

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

/* Small text muted style */
.text-muted {
    color: var(--text-muted) !important;
}

/* Utility classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-weight-bold {
    font-weight: 600 !important;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

/* Parts summary styles */
.partes-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

/* Table footer styles */
.table tfoot tr {
    background-color: var(--bg-tertiary);
    border-top: 2px solid var(--border-color);
}

.table tfoot td {
    font-weight: 600;
}

.report-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end; /* Align buttons to the right */
    margin-top: 1rem; /* Add some space above buttons */
}

/* Loading spinner styles if not already global */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.text-center {
    text-align: center;
}
.p-3 {
    padding: 1rem; /* Or your preferred padding */
}
.text-danger {
    color: var(--danger-color, #dc3545);
}
.mt-3 {
    margin-top: 1rem; /* Or your preferred margin */
}

/* Additional style for first detail section to reduce spacing */
.detail-section:first-of-type {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
