/* Condition Report Styles */

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    padding: 3rem 0 2rem 0;
    overflow: visible;
    min-height: 120px;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
    overflow: visible;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: visible;
    flex-shrink: 0;
}

.progress-step-number {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 2px solid hsl(var(--muted));
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    transition: all 0.3s;
    flex-shrink: 0;
}

.progress-step.active .progress-step-number {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary));
    color: white;
}

.progress-step.completed .progress-step-number {
    border-color: hsl(145 65% 45%);
    background: hsl(145 65% 45%);
    color: white;
}

.progress-step-label {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
}

.progress-step.active .progress-step-label {
    color: hsl(var(--foreground));
}

.progress-line {
    flex: 1;
    height: 2px;
    background: hsl(var(--muted));
    margin: 0 1rem;
    margin-bottom: 2rem;
    transition: all 0.3s;
}

.progress-line.completed {
    background: hsl(145 65% 45%);
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.photo-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.photo-item {
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: all 0.2s;
    position: relative;
}

.photo-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.photo-thumbnail img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid hsl(var(--border));
}

.photo-info {
    padding: 1rem;
}

.photo-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.photo-info p {
    margin: 0;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.photo-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / 0.3);
}

.btn-icon {
    background: white;
    border: 1px solid hsl(var(--border));
    padding: 0.625rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    min-width: 2.5rem;
    min-height: 2.5rem;
}

.btn-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-icon:hover {
    background: hsl(var(--muted));
    border-color: hsl(var(--foreground));
    box-shadow: var(--shadow-sm);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-icon.delete-photo:hover {
    background: hsl(var(--destructive));
    color: white;
    border-color: hsl(var(--destructive));
}

.photo-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: hsl(var(--muted-foreground));
}

.photo-empty-state svg {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
}

.photo-empty-state p {
    margin: 0;
    font-size: 1.125rem;
}

/* Photo Upload Buttons */
.photo-upload-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed hsl(var(--border));
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: hsl(var(--muted) / 0.3);
    transition: all var(--transition-base);
    margin-bottom: 2rem;
}

.drop-zone.drag-over {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.1);
    box-shadow: 0 0 0 4px hsl(var(--primary) / 0.1);
}

.drop-zone-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: hsl(var(--muted-foreground));
}

.drop-zone.drag-over .drop-zone-icon {
    color: hsl(var(--primary));
}

.drop-zone h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: hsl(var(--foreground));
}

.drop-zone p {
    margin: 0;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* Signature Pad */
#signature-canvas {
    touch-action: none;
    width: 100%;
    max-width: 600px;
}

/* Modal - Page-specific overrides */
.modal-content.modal-large {
    max-width: 700px;
}

/* Edit Photo Modal */
.edit-photo-preview {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid hsl(var(--border));
    margin-bottom: 1.5rem;
}

/* Form Error Styles */
.form-error {
    color: hsl(0 72% 51%);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Clickable Table Rows */
.clickable-row {
    transition: background-color 0.2s ease;
}

.clickable-row:hover {
    background-color: hsl(var(--muted) / 0.5) !important;
}

.clickable-row:active {
    background-color: hsl(var(--muted) / 0.7) !important;
}

/* Signature Image */
.signature-image {
    max-width: 400px;
    width: 100%;
    height: auto;
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    padding: 1rem;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .progress-bar-container {
        display: none;
    }

    /* Form fields stack vertically on mobile */
    .card form > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Form action buttons stack vertically on mobile */
    .card form > div[style*="display: flex"][style*="justify-content: space-between"],
    .card > div > div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    /* Nested button groups also stack */
    .card form > div[style*="display: flex"] > div[style*="display: flex"],
    .card > div > div[style*="display: flex"] > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100%;
    }

    /* All buttons in forms become full width */
    .card form .btn,
    .card > div .btn {
        width: 100% !important;
    }

    .photo-grid {
        grid-template-columns: 1fr;
    }

    .photo-upload-buttons {
        flex-direction: column;
    }

    .photo-upload-buttons .btn {
        width: 100%;
    }

    /* Signature fits mobile screen */
    .signature-image {
        max-width: 100%;
        padding: 0.75rem;
    }
}
