/* static/css/my_fixes.css */

.my-fixes-wrapper {
    background-color: var(--dark-bg);
    padding: 2.5rem 1.5rem;
    min-height: calc(100vh - 120px);
}

.my-fixes-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: transparent;
    padding: 0;
}

.my-fixes-container h2 {
    color: var(--light-text);
    border-bottom-color: var(--card-border);
}

.my-fixes-container > p {
    color: var(--medium-text);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

#my-fixes-status-message {
    margin-bottom: 2rem;
}

.fixes-table-container {
    background-color: var(--card-bg);
    color: #111827;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

#my-fixes-table {
    width: 100%;
    border-collapse: collapse;
}

#my-fixes-table thead {
    background-color: #f9fafb;
}

#my-fixes-table thead tr {
    display: grid;
    grid-template-columns: 2fr 2.2fr 1.3fr 1.3fr 1.3fr 1.3fr;
    gap: 1rem;
    padding: 0 20px 0 120px;
}

#my-fixes-table th {
    padding: 15px 0;
    text-align: right;
    font-weight: 700;
    color: #374151;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fix-request-row .main-content-cell {
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
}

.fix-request-row:last-of-type .main-content-cell {
    border-bottom: none;
}

.row-summary-grid {
    display: grid;
    grid-template-columns: 2fr 2.2fr 1.3fr 1.3fr 1.3fr 1.3fr;
    align-items: center;
    gap: 1rem;
    padding: 10px 20px 10px 120px;
    transition: background-color 0.2s ease;
}

.fix-request-row[data-status="completed"]:hover .row-summary-grid {
    background-color: #f3f4f6;
}

tr[data-status="completed"] {
    cursor: pointer;
}

.grid-item {
    display: flex;
    align-items: center;
}

.preview-item {
    align-items: flex-start !important;
    display: block !important;
}
.reason-item {
    justify-content: flex-start;
    text-align: right;
    font-weight: 600;
    color: #111827;
}
.status-item {
    justify-content: flex-start;
    text-align: right;
}
.date-item {
    justify-content: flex-start;
    text-align: right;
}
.actions-item {
    justify-content: flex-start;
    gap: 8px;
}

.fix-preview-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.fix-image-section {
    display: flex;
    gap: 10px;
}

.fix-image-section .image-container {
    text-align: center;
}

.fix-image-section .image-container img, .fix-image-section .image-container .placeholder {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    background-color: #f3f4f6;
}

.fix-image-section .image-container span {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

.fix-info-section {
    font-size: 0.9em;
}

.fix-title {
    font-size: 1em;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}

.fix-subtitle {
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 4px;
}

.fix-notes {
    font-size: 0.8em;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

.fix-notes strong {
    color: #4b5563;
}

.status-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85em;
}
.status-tag.pending { background-color: #fef9c3; color: #854d0e; }
.status-tag.completed { background-color: #dcfce7; color: #166534; }

.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.actions-cell .button {
    padding: 6px;
    font-size: 1rem;
    min-width: 32px;
    height: 32px;
    line-height: 1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.actions-cell .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.actions-cell .button:disabled:hover {
    transform: none;
    opacity: 0.5;
}

.download-fix-btn {
    background-color: #3b82f6;
    color: white;
}

.download-fix-btn:hover {
    background-color: #2563eb;
}

.approve-fix-btn {
    background-color: #10b981;
    color: white;
}

.approve-fix-btn:hover {
    background-color: #059669;
}

.reject-fix-btn {
    background-color: #ef4444;
    color: white;
}

.reject-fix-btn:hover {
    background-color: #dc2626;
}

.delete-fix-request-btn {
    background-color: #6b7280;
    color: white;
}

.delete-fix-request-btn:hover {
    background-color: #4b5563;
}

/* --- Expandable Row Styles --- */
.detail-row {
    display: none; /* Hidden by default */
}

.fix-request-row.expanded + .detail-row {
    display: table-row; /* Show the detail row when the main row is expanded */
}

.fix-request-row.expanded .row-summary-grid {
    background-color: #eef2ff; /* Light indigo background for expanded row */
}

.detail-row td {
    padding: 0;
    border-top: 2px solid #c7d2fe; /* Indigo border */
}

.detail-content-wrapper {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    padding: 2rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.detail-content-wrapper .comparison-image-container {
    flex: 1;
    text-align: center;
}

.detail-content-wrapper .comparison-image-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
}

/* Cursor Logic */
tr[data-status="pending"] .comparison-thumb {
    cursor: zoom-in;
}

#my-fixes-loading, #my-fixes-empty {
    text-align: center;
    color: var(--medium-text);
    margin-top: 40px;
    padding: 3rem;
    background-color: var(--dark-bg-secondary);
    border: 1px dashed var(--card-border);
    border-radius: 12px;
    font-size: 1.1rem;
    line-height: 1.7;
}

@media (max-width: 767px) {
    #my-fixes-table thead { display: none; }
    .fix-request-row, .detail-row { display: block; margin-bottom: 1rem; }
    .row-summary-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 0.5rem;
    }
    .grid-item { justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #f3f4f6; }
    .grid-item:last-child { border-bottom: none; }
    .grid-item::before { content: attr(data-label); font-weight: 700; }
    .preview-item::before { content: "תצוגה"; }
    .reason-item::before { content: "סיבת התיקון"; }
    .status-item::before { content: "סטטוס"; }
    .request-date-item::before { content: attr(data-label); }
    .completion-date-item::before { content: attr(data-label); }
    .actions-item::before { content: "פעולות"; }
    .detail-content-wrapper { flex-direction: column; }
}

/* Header actions (language switcher + logout button) */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-actions .language-switcher {
    margin: 0;
}

.header-actions #logout-button {
    white-space: nowrap;
}
